18
18
import * as http2 from 'http2' ;
19
19
import * as util from 'util' ;
20
20
21
+ import { CipherNameAndProtocol , TLSSocket } from 'tls' ;
21
22
import { ServiceError } from './call' ;
22
- import { Status , LogVerbosity } from './constants' ;
23
+ import { PartialStatusObject } from './call-interface' ;
24
+ import { ChannelOptions } from './channel-options' ;
25
+ import {
26
+ ChannelzCallTracker ,
27
+ ChannelzCallTrackerStub ,
28
+ ChannelzChildrenTracker ,
29
+ ChannelzChildrenTrackerStub ,
30
+ ChannelzTrace ,
31
+ ChannelzTraceStub ,
32
+ ServerInfo ,
33
+ ServerRef ,
34
+ SocketInfo ,
35
+ SocketRef ,
36
+ TlsInfo ,
37
+ registerChannelzServer ,
38
+ registerChannelzSocket ,
39
+ unregisterChannelzRef ,
40
+ } from './channelz' ;
41
+ import { LogVerbosity , Status } from './constants' ;
42
+ import * as logging from './logging' ;
23
43
import { Deserialize , Serialize , ServiceDefinition } from './make-client' ;
24
44
import { Metadata } from './metadata' ;
45
+ import {
46
+ ResolverListener ,
47
+ createResolver ,
48
+ mapUriDefaultScheme ,
49
+ } from './resolver' ;
25
50
import {
26
51
BidiStreamingHandler ,
27
52
ClientStreamingHandler ,
28
53
HandleCall ,
29
54
Handler ,
30
55
HandlerType ,
31
- sendUnaryData ,
32
56
ServerDuplexStream ,
33
57
ServerDuplexStreamImpl ,
58
+ ServerErrorResponse ,
34
59
ServerReadableStream ,
60
+ ServerStatusResponse ,
35
61
ServerStreamingHandler ,
36
62
ServerUnaryCall ,
37
63
ServerWritableStream ,
38
64
ServerWritableStreamImpl ,
39
65
UnaryHandler ,
40
- ServerErrorResponse ,
41
- ServerStatusResponse ,
66
+ sendUnaryData ,
42
67
serverErrorToStatus ,
43
68
} from './server-call' ;
44
69
import { ServerCredentials } from './server-credentials' ;
45
- import { ChannelOptions } from './channel-options' ;
46
70
import {
47
- createResolver ,
48
- ResolverListener ,
49
- mapUriDefaultScheme ,
50
- } from './resolver' ;
51
- import * as logging from './logging' ;
71
+ ServerInterceptingCallInterface ,
72
+ ServerInterceptor ,
73
+ getServerInterceptingCall ,
74
+ } from './server-interceptors' ;
52
75
import {
53
76
SubchannelAddress ,
54
77
isTcpSubchannelAddress ,
55
- subchannelAddressToString ,
56
78
stringToSubchannelAddress ,
79
+ subchannelAddressToString ,
57
80
} from './subchannel-address' ;
81
+ import { CallEventTracker } from './transport' ;
58
82
import {
59
83
GrpcUri ,
60
84
combineHostPort ,
61
85
parseUri ,
62
86
splitHostPort ,
63
87
uriToString ,
64
88
} from './uri-parser' ;
65
- import {
66
- ChannelzCallTracker ,
67
- ChannelzCallTrackerStub ,
68
- ChannelzChildrenTracker ,
69
- ChannelzChildrenTrackerStub ,
70
- ChannelzTrace ,
71
- ChannelzTraceStub ,
72
- registerChannelzServer ,
73
- registerChannelzSocket ,
74
- ServerInfo ,
75
- ServerRef ,
76
- SocketInfo ,
77
- SocketRef ,
78
- TlsInfo ,
79
- unregisterChannelzRef ,
80
- } from './channelz' ;
81
- import { CipherNameAndProtocol , TLSSocket } from 'tls' ;
82
- import {
83
- ServerInterceptingCallInterface ,
84
- ServerInterceptor ,
85
- getServerInterceptingCall ,
86
- } from './server-interceptors' ;
87
- import { PartialStatusObject } from './call-interface' ;
88
- import { CallEventTracker } from './transport' ;
89
89
90
90
const UNLIMITED_CONNECTION_AGE_MS = ~ ( 1 << 31 ) ;
91
91
const KEEPALIVE_MAX_TIME_MS = ~ ( 1 << 31 ) ;
@@ -1469,6 +1469,12 @@ export class Server {
1469
1469
clearKeepaliveTimeout ( ) ;
1470
1470
if ( err ) {
1471
1471
this . keepaliveTrace ( 'Ping failed with error: ' + err . message ) ;
1472
+ this . trace (
1473
+ 'Connection dropped due to error of a ping frame ' +
1474
+ err . message +
1475
+ ' return in ' +
1476
+ duration
1477
+ ) ;
1472
1478
sessionClosedByServer = true ;
1473
1479
session . close ( ) ;
1474
1480
} else {
@@ -1480,6 +1486,7 @@ export class Server {
1480
1486
1481
1487
if ( ! pingSentSuccessfully ) {
1482
1488
this . keepaliveTrace ( 'Ping failed to send' ) ;
1489
+ this . trace ( 'Connection dropped due to failure to send ping frame' ) ;
1483
1490
sessionClosedByServer = true ;
1484
1491
session . close ( ) ;
1485
1492
return ;
0 commit comments