@grpc/grpc-js
Advanced tools
Comparing version 1.11.1 to 1.11.2
@@ -263,7 +263,9 @@ "use strict"; | ||
const error = new Error(); | ||
(0, logging_1.trace)(constants_1.LogVerbosity.DEBUG, 'channel_stacktrace', '(' + | ||
this.channelzRef.id + | ||
') ' + | ||
'Channel constructed \n' + | ||
((_h = error.stack) === null || _h === void 0 ? void 0 : _h.substring(error.stack.indexOf('\n') + 1))); | ||
if ((0, logging_1.isTracerEnabled)('channel_stacktrace')) { | ||
(0, logging_1.trace)(constants_1.LogVerbosity.DEBUG, 'channel_stacktrace', '(' + | ||
this.channelzRef.id + | ||
') ' + | ||
'Channel constructed \n' + | ||
((_h = error.stack) === null || _h === void 0 ? void 0 : _h.substring(error.stack.indexOf('\n') + 1))); | ||
} | ||
this.lastActivityTimestamp = new Date(); | ||
@@ -270,0 +272,0 @@ } |
@@ -277,4 +277,7 @@ "use strict"; | ||
isStatusCodeInList(list, code) { | ||
return list.some(value => value === code || | ||
value.toString().toLowerCase() === constants_1.Status[code].toLowerCase()); | ||
return list.some(value => { | ||
var _a; | ||
return value === code || | ||
value.toString().toLowerCase() === ((_a = constants_1.Status[code]) === null || _a === void 0 ? void 0 : _a.toLowerCase()); | ||
}); | ||
} | ||
@@ -281,0 +284,0 @@ getNextRetryBackoffMs() { |
@@ -124,5 +124,4 @@ "use strict"; | ||
session.once('error', error => { | ||
/* Do nothing here. Any error should also trigger a close event, which is | ||
* where we want to handle that. */ | ||
this.trace('connection closed with error ' + error.message); | ||
this.handleDisconnect(); | ||
}); | ||
@@ -248,2 +247,5 @@ if (logging.isTracerEnabled(TRACER_NAME)) { | ||
handleDisconnect() { | ||
if (this.disconnectHandled) { | ||
return; | ||
} | ||
this.clearKeepaliveTimeout(); | ||
@@ -578,2 +580,3 @@ this.reportDisconnectToOwner(false); | ||
let errorMessage = 'Failed to connect'; | ||
let reportedError = false; | ||
session.unref(); | ||
@@ -589,3 +592,6 @@ session.once('connect', () => { | ||
setImmediate(() => { | ||
reject(`${errorMessage} (${new Date().toISOString()})`); | ||
if (!reportedError) { | ||
reportedError = true; | ||
reject(`${errorMessage} (${new Date().toISOString()})`); | ||
} | ||
}); | ||
@@ -596,2 +602,6 @@ }); | ||
this.trace('connection failed with error ' + errorMessage); | ||
if (!reportedError) { | ||
reportedError = true; | ||
reject(`${errorMessage} (${new Date().toISOString()})`); | ||
} | ||
}); | ||
@@ -598,0 +608,0 @@ }); |
{ | ||
"name": "@grpc/grpc-js", | ||
"version": "1.11.1", | ||
"version": "1.11.2", | ||
"description": "gRPC Library for Node - pure JS implementation", | ||
@@ -5,0 +5,0 @@ "homepage": "https://grpc.io/", |
@@ -34,3 +34,3 @@ /* | ||
} from './resolver'; | ||
import { trace } from './logging'; | ||
import { trace, isTracerEnabled } from './logging'; | ||
import { SubchannelAddress } from './subchannel-address'; | ||
@@ -428,11 +428,13 @@ import { mapProxyName } from './http_proxy'; | ||
const error = new Error(); | ||
trace( | ||
LogVerbosity.DEBUG, | ||
'channel_stacktrace', | ||
'(' + | ||
this.channelzRef.id + | ||
') ' + | ||
'Channel constructed \n' + | ||
error.stack?.substring(error.stack.indexOf('\n') + 1) | ||
); | ||
if (isTracerEnabled('channel_stacktrace')){ | ||
trace( | ||
LogVerbosity.DEBUG, | ||
'channel_stacktrace', | ||
'(' + | ||
this.channelzRef.id + | ||
') ' + | ||
'Channel constructed \n' + | ||
error.stack?.substring(error.stack.indexOf('\n') + 1) | ||
); | ||
} | ||
this.lastActivityTimestamp = new Date(); | ||
@@ -439,0 +441,0 @@ } |
@@ -401,3 +401,3 @@ /* | ||
value === code || | ||
value.toString().toLowerCase() === Status[code].toLowerCase() | ||
value.toString().toLowerCase() === Status[code]?.toLowerCase() | ||
); | ||
@@ -404,0 +404,0 @@ } |
@@ -226,5 +226,4 @@ /* | ||
session.once('error', error => { | ||
/* Do nothing here. Any error should also trigger a close event, which is | ||
* where we want to handle that. */ | ||
this.trace('connection closed with error ' + (error as Error).message); | ||
this.handleDisconnect(); | ||
}); | ||
@@ -387,2 +386,5 @@ | ||
private handleDisconnect() { | ||
if (this.disconnectHandled) { | ||
return; | ||
} | ||
this.clearKeepaliveTimeout(); | ||
@@ -773,2 +775,3 @@ this.reportDisconnectToOwner(false); | ||
let errorMessage = 'Failed to connect'; | ||
let reportedError = false; | ||
session.unref(); | ||
@@ -784,3 +787,6 @@ session.once('connect', () => { | ||
setImmediate(() => { | ||
reject(`${errorMessage} (${new Date().toISOString()})`); | ||
if (!reportedError) { | ||
reportedError = true; | ||
reject(`${errorMessage} (${new Date().toISOString()})`); | ||
} | ||
}); | ||
@@ -791,2 +797,6 @@ }); | ||
this.trace('connection failed with error ' + errorMessage); | ||
if (!reportedError) { | ||
reportedError = true; | ||
reject(`${errorMessage} (${new Date().toISOString()})`); | ||
} | ||
}); | ||
@@ -793,0 +803,0 @@ }); |
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
1888614
38640