@grpc/grpc-js
Advanced tools
Comparing version 1.5.7 to 1.5.8
@@ -159,2 +159,3 @@ /// <reference types="node" /> | ||
addFilters(extraFilters: Filter[]): void; | ||
getCallNumber(): number; | ||
startRead(): void; | ||
@@ -161,0 +162,0 @@ private maybeCloseWrites; |
@@ -612,2 +612,5 @@ "use strict"; | ||
} | ||
getCallNumber() { | ||
return this.callNumber; | ||
} | ||
startRead() { | ||
@@ -614,0 +617,0 @@ /* If the stream has ended with an error, we should not emit any more |
@@ -244,3 +244,3 @@ "use strict"; | ||
tryPick(callStream, callMetadata, callConfig, dynamicFilters) { | ||
var _a, _b, _c; | ||
var _a, _b; | ||
const pickResult = this.currentPicker.pick({ | ||
@@ -250,7 +250,13 @@ metadata: callMetadata, | ||
}); | ||
this.trace('Pick result: ' + | ||
const subchannelString = pickResult.subchannel ? | ||
'(' + pickResult.subchannel.getChannelzRef().id + ') ' + pickResult.subchannel.getAddress() : | ||
'' + pickResult.subchannel; | ||
this.trace('Pick result for call [' + | ||
callStream.getCallNumber() + | ||
']: ' + | ||
picker_1.PickResultType[pickResult.pickResultType] + | ||
' subchannel: ' + ((_a = pickResult.subchannel) === null || _a === void 0 ? void 0 : _a.getAddress()) + | ||
' status: ' + ((_b = pickResult.status) === null || _b === void 0 ? void 0 : _b.code) + | ||
' ' + ((_c = pickResult.status) === null || _c === void 0 ? void 0 : _c.details)); | ||
' subchannel: ' + | ||
subchannelString + | ||
' status: ' + ((_a = pickResult.status) === null || _a === void 0 ? void 0 : _a.code) + | ||
' ' + ((_b = pickResult.status) === null || _b === void 0 ? void 0 : _b.details)); | ||
switch (pickResult.pickResultType) { | ||
@@ -269,3 +275,3 @@ case picker_1.PickResultType.COMPLETE: | ||
logging_1.log(constants_1.LogVerbosity.ERROR, 'Error: COMPLETE pick result subchannel ' + | ||
pickResult.subchannel.getAddress() + | ||
subchannelString + | ||
' has state ' + | ||
@@ -310,3 +316,3 @@ connectivity_state_1.ConnectivityState[pickResult.subchannel.getConnectivityState()]); | ||
this.trace('Failed to start call on picked subchannel ' + | ||
pickResult.subchannel.getAddress() + | ||
subchannelString + | ||
' with error ' + | ||
@@ -319,3 +325,3 @@ error.message + | ||
this.trace('Failed to start call on picked subchanel ' + | ||
pickResult.subchannel.getAddress() + | ||
subchannelString + | ||
' with error ' + | ||
@@ -332,3 +338,3 @@ error.message + | ||
this.trace('Picked subchannel ' + | ||
pickResult.subchannel.getAddress() + | ||
subchannelString + | ||
' has state ' + | ||
@@ -335,0 +341,0 @@ connectivity_state_1.ConnectivityState[subchannelState] + |
@@ -30,3 +30,3 @@ "use strict"; | ||
const subchannel_interface_1 = require("./subchannel-interface"); | ||
const TYPE_NAME = 'pick_first'; | ||
const TYPE_NAME = 'outlier_detection'; | ||
const OUTLIER_DETECTION_ENABLED = process.env.GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION === 'true'; | ||
@@ -53,8 +53,10 @@ const defaultSuccessRateEjectionConfig = { | ||
const fullFieldName = objectName ? `${objectName}.${fieldName}` : fieldName; | ||
if (fieldName in obj && !duration_1.isDuration(obj[fieldName])) { | ||
throw new Error(`outlier detection config ${fullFieldName} parse error: expected Duration, got ${typeof obj[fieldName]}`); | ||
if (fieldName in obj) { | ||
if (!duration_1.isDuration(obj[fieldName])) { | ||
throw new Error(`outlier detection config ${fullFieldName} parse error: expected Duration, got ${typeof obj[fieldName]}`); | ||
} | ||
if (!(obj[fieldName].seconds >= 0 && obj[fieldName].seconds <= 315576000000 && obj[fieldName].nanos >= 0 && obj[fieldName].nanos <= 999999999)) { | ||
throw new Error(`outlier detection config ${fullFieldName} parse error: values out of range for non-negative Duaration`); | ||
} | ||
} | ||
if (!(obj[fieldName].seconds >= 0 && obj[fieldName].seconds <= 315576000000 && obj[fieldName].nanos >= 0 && obj[fieldName].nanos <= 999999999)) { | ||
throw new Error(`outlier detection config ${fullFieldName} parse error: values out of range for non-negative Duaration`); | ||
} | ||
} | ||
@@ -64,3 +66,3 @@ function validatePercentage(obj, fieldName, objectName) { | ||
validateFieldType(obj, fieldName, 'number', objectName); | ||
if (!(obj[fieldName] >= 0 && obj[fieldName] <= 100)) { | ||
if (fieldName in obj && !(obj[fieldName] >= 0 && obj[fieldName] <= 100)) { | ||
throw new Error(`outlier detection config ${fullFieldName} parse error: value out of range for percentage (0-100)`); | ||
@@ -67,0 +69,0 @@ } |
@@ -673,3 +673,3 @@ "use strict"; | ||
} | ||
logging.trace(constants_1.LogVerbosity.DEBUG, 'call_stream', 'Starting stream on subchannel ' + | ||
logging.trace(constants_1.LogVerbosity.DEBUG, 'call_stream', 'Starting stream [' + callStream.getCallNumber() + '] on subchannel ' + | ||
'(' + this.channelzRef.id + ') ' + | ||
@@ -676,0 +676,0 @@ this.subchannelAddressString + |
{ | ||
"name": "@grpc/grpc-js", | ||
"version": "1.5.7", | ||
"version": "1.5.8", | ||
"description": "gRPC Library for Node - pure JS implementation", | ||
@@ -5,0 +5,0 @@ "homepage": "https://grpc.io/", |
@@ -798,2 +798,6 @@ /* | ||
getCallNumber() { | ||
return this.callNumber; | ||
} | ||
startRead() { | ||
@@ -800,0 +804,0 @@ /* If the stream has ended with an error, we should not emit any more |
@@ -407,7 +407,12 @@ /* | ||
}); | ||
const subchannelString = pickResult.subchannel ? | ||
'(' + pickResult.subchannel.getChannelzRef().id + ') ' + pickResult.subchannel.getAddress() : | ||
'' + pickResult.subchannel; | ||
this.trace( | ||
'Pick result: ' + | ||
'Pick result for call [' + | ||
callStream.getCallNumber() + | ||
']: ' + | ||
PickResultType[pickResult.pickResultType] + | ||
' subchannel: ' + | ||
pickResult.subchannel?.getAddress() + | ||
subchannelString + | ||
' status: ' + | ||
@@ -437,3 +442,3 @@ pickResult.status?.code + | ||
'Error: COMPLETE pick result subchannel ' + | ||
pickResult.subchannel!.getAddress() + | ||
subchannelString + | ||
' has state ' + | ||
@@ -485,3 +490,3 @@ ConnectivityState[pickResult.subchannel!.getConnectivityState()] | ||
'Failed to start call on picked subchannel ' + | ||
pickResult.subchannel!.getAddress() + | ||
subchannelString + | ||
' with error ' + | ||
@@ -496,3 +501,3 @@ (error as Error).message + | ||
'Failed to start call on picked subchanel ' + | ||
pickResult.subchannel!.getAddress() + | ||
subchannelString + | ||
' with error ' + | ||
@@ -516,3 +521,3 @@ (error as Error).message + | ||
'Picked subchannel ' + | ||
pickResult.subchannel!.getAddress() + | ||
subchannelString + | ||
' has state ' + | ||
@@ -519,0 +524,0 @@ ConnectivityState[subchannelState] + |
@@ -860,3 +860,3 @@ /* | ||
'call_stream', | ||
'Starting stream on subchannel ' + | ||
'Starting stream [' + callStream.getCallNumber() + '] on subchannel ' + | ||
'(' + this.channelzRef.id + ') ' + | ||
@@ -863,0 +863,0 @@ this.subchannelAddressString + |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1410162
28328