File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed
Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ export class BaseClient {
126126 // So SDK should support max_receive_message_length unlimited.
127127 'grpc.max_receive_message_length' : - 1 , // set max_receive_message_length to unlimited
128128 'grpc.max_send_message_length' : - 1 , // set max_send_message_length to unlimited
129- 'grpc.keepalive_time_ms' : 55 * 1000 , // Send keepalive pings every 55 seconds, default is 2 hours.
129+ 'grpc.keepalive_time_ms' : 10 * 1000 , // Send keepalive pings every 10 seconds, default is 2 hours.
130130 'grpc.keepalive_timeout_ms' : 5 * 1000 , // Keepalive ping timeout after 5 seconds, default is 20 seconds.
131131 'grpc.keepalive_permit_without_calls' : 1 , // Allow keepalive pings when there are no gRPC calls.
132132 'grpc.enable_retries' : 1 , // enable retry
Original file line number Diff line number Diff line change @@ -195,6 +195,36 @@ describe(`Milvus client`, () => {
195195 }
196196 } ) ;
197197
198+ it ( `should have default keepalive options set to 10s interval and 5s timeout` , async ( ) => {
199+ const client = new MilvusClient ( {
200+ address : IP ,
201+ __SKIP_CONNECT__ : true ,
202+ } ) ;
203+
204+ expect ( client . channelOptions [ 'grpc.keepalive_time_ms' ] ) . toEqual ( 10000 ) ;
205+ expect ( client . channelOptions [ 'grpc.keepalive_timeout_ms' ] ) . toEqual ( 5000 ) ;
206+ expect ( client . channelOptions [ 'grpc.keepalive_permit_without_calls' ] ) . toEqual (
207+ 1
208+ ) ;
209+ } ) ;
210+
211+ it ( `should allow overriding keepalive options via channelOptions` , async ( ) => {
212+ const client = new MilvusClient ( {
213+ address : IP ,
214+ channelOptions : {
215+ 'grpc.keepalive_time_ms' : 20000 ,
216+ 'grpc.keepalive_timeout_ms' : 8000 ,
217+ } ,
218+ __SKIP_CONNECT__ : true ,
219+ } ) ;
220+
221+ expect ( client . channelOptions [ 'grpc.keepalive_time_ms' ] ) . toEqual ( 20000 ) ;
222+ expect ( client . channelOptions [ 'grpc.keepalive_timeout_ms' ] ) . toEqual ( 8000 ) ;
223+ expect ( client . channelOptions [ 'grpc.keepalive_permit_without_calls' ] ) . toEqual (
224+ 1
225+ ) ;
226+ } ) ;
227+
198228 it ( `should add trace interceptor if enableTrace is true` , async ( ) => {
199229 const nonTraceClient = new MilvusClient ( {
200230 address : IP ,
You can’t perform that action at this time.
0 commit comments