File tree Expand file tree Collapse file tree 6 files changed +35
-4
lines changed Expand file tree Collapse file tree 6 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @grpc/grpc-js" ,
3
- "version" : " 1.3.5 " ,
3
+ "version" : " 1.3.7 " ,
4
4
"description" : " gRPC Library for Node - pure JS implementation" ,
5
5
"homepage" : " https://grpc.io/" ,
6
6
"repository" : " https://github.com/grpc/grpc-node/tree/master/packages/grpc-js" ,
Original file line number Diff line number Diff line change @@ -658,7 +658,15 @@ export class Http2CallStream implements Call {
658
658
this . pendingWrite . length +
659
659
' (deferred)'
660
660
) ;
661
- stream . write ( this . pendingWrite , this . pendingWriteCallback ) ;
661
+ try {
662
+ stream . write ( this . pendingWrite , this . pendingWriteCallback ) ;
663
+ } catch ( error ) {
664
+ this . endCall ( {
665
+ code : Status . UNAVAILABLE ,
666
+ details : `Write failed with error ${ error . message } ` ,
667
+ metadata : new Metadata ( )
668
+ } ) ;
669
+ }
662
670
}
663
671
this . maybeCloseWrites ( ) ;
664
672
}
@@ -790,7 +798,15 @@ export class Http2CallStream implements Call {
790
798
this . pendingWriteCallback = cb ;
791
799
} else {
792
800
this . trace ( 'sending data chunk of length ' + message . message . length ) ;
793
- this . http2Stream . write ( message . message , cb ) ;
801
+ try {
802
+ this . http2Stream . write ( message . message , cb ) ;
803
+ } catch ( error ) {
804
+ this . endCall ( {
805
+ code : Status . UNAVAILABLE ,
806
+ details : `Write failed with error ${ error . message } ` ,
807
+ metadata : new Metadata ( )
808
+ } ) ;
809
+ }
794
810
this . maybeCloseWrites ( ) ;
795
811
}
796
812
} , this . handleFilterError . bind ( this ) ) ;
Original file line number Diff line number Diff line change @@ -256,6 +256,12 @@ export function getProxiedConnection(
256
256
reject ( ) ;
257
257
} ) ;
258
258
} else {
259
+ trace (
260
+ 'Successfully established a plaintext connection to ' +
261
+ options . path +
262
+ ' through proxy ' +
263
+ proxyAddressString
264
+ ) ;
259
265
resolve ( {
260
266
socket,
261
267
realTarget : parsedTarget ,
Original file line number Diff line number Diff line change @@ -258,7 +258,10 @@ import * as resolver_ip from './resolver-ip';
258
258
import * as load_balancer_pick_first from './load-balancer-pick-first' ;
259
259
import * as load_balancer_round_robin from './load-balancer-round-robin' ;
260
260
261
+ const clientVersion = require ( '../../package.json' ) . version ;
262
+
261
263
( ( ) => {
264
+ logging . trace ( LogVerbosity . DEBUG , 'index' , 'Loading @grpc/grpc-js version ' + clientVersion ) ;
262
265
resolver_dns . setup ( ) ;
263
266
resolver_uds . setup ( ) ;
264
267
resolver_ip . setup ( ) ;
Original file line number Diff line number Diff line change @@ -431,7 +431,7 @@ export class Http2ServerCallStream<
431
431
private checkCancelled ( ) : boolean {
432
432
/* In some cases the stream can become destroyed before the close event
433
433
* fires. That creates a race condition that this check works around */
434
- if ( this . stream . destroyed ) {
434
+ if ( this . stream . destroyed || this . stream . closed ) {
435
435
this . cancelled = true ;
436
436
}
437
437
return this . cancelled ;
Original file line number Diff line number Diff line change @@ -266,6 +266,11 @@ export class Subchannel {
266
266
}
267
267
268
268
private createSession ( proxyConnectionResult : ProxyConnectionResult ) {
269
+ if ( proxyConnectionResult . realTarget ) {
270
+ trace ( this . subchannelAddressString + ' creating HTTP/2 session through proxy to ' + proxyConnectionResult . realTarget ) ;
271
+ } else {
272
+ trace ( this . subchannelAddressString + ' creating HTTP/2 session' ) ;
273
+ }
269
274
const targetAuthority = getDefaultAuthority (
270
275
proxyConnectionResult . realTarget ?? this . channelTarget
271
276
) ;
@@ -368,6 +373,7 @@ export class Subchannel {
368
373
} ) ;
369
374
session . once ( 'close' , ( ) => {
370
375
if ( this . session === session ) {
376
+ trace ( this . subchannelAddressString + ' connection closed' ) ;
371
377
this . transitionToState (
372
378
[ ConnectivityState . CONNECTING ] ,
373
379
ConnectivityState . TRANSIENT_FAILURE
You can’t perform that action at this time.
0 commit comments