File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use crate::Result;
4
4
use grpcio:: { Channel , ChannelBuilder , ChannelCredentialsBuilder , Environment } ;
5
5
use regex:: Regex ;
6
6
use std:: {
7
+ ffi:: CString ,
7
8
fs:: File ,
8
9
io:: Read ,
9
10
path:: { Path , PathBuf } ,
@@ -76,9 +77,12 @@ impl SecurityManager {
76
77
77
78
let addr = SCHEME_REG . replace ( addr, "" ) ;
78
79
80
+ // Set grpc.use_local_subchannel_pool will ensure every TiKV client instance can has it's own
81
+ // connection to TiKV server.
79
82
let cb = ChannelBuilder :: new ( env)
80
83
. keepalive_time ( Duration :: from_secs ( 10 ) )
81
- . keepalive_timeout ( Duration :: from_secs ( 3 ) ) ;
84
+ . keepalive_timeout ( Duration :: from_secs ( 3 ) )
85
+ . raw_cfg_int ( CString :: new ( "grpc.use_local_subchannel_pool" ) . unwrap ( ) , 1 ) ;
82
86
83
87
let channel = if self . ca . is_empty ( ) {
84
88
cb. connect ( & addr)
You can’t perform that action at this time.
0 commit comments