@@ -5,7 +5,7 @@ use linkerd_app_core::{
55 control:: { Config as ControlConfig , ControlAddr } ,
66 proxy:: http:: { h1, h2} ,
77 tls,
8- transport:: { DualListenAddr , Keepalive , ListenAddr , UserTimeout } ,
8+ transport:: { DualListenAddr , Keepalive , ListenAddr , UserTimeout , Backlog } ,
99 AddrMatch , Conditional , IpNet ,
1010} ;
1111use std:: { collections:: HashSet , net:: SocketAddr , path:: PathBuf , time:: Duration } ;
@@ -133,6 +133,9 @@ const ENV_OUTBOUND_ACCEPT_USER_TIMEOUT: &str = "LINKERD2_PROXY_OUTBOUND_ACCEPT_U
133133const ENV_INBOUND_CONNECT_USER_TIMEOUT : & str = "LINKERD2_PROXY_INBOUND_CONNECT_USER_TIMEOUT" ;
134134const ENV_OUTBOUND_CONNECT_USER_TIMEOUT : & str = "LINKERD2_PROXY_OUTBOUND_CONNECT_USER_TIMEOUT" ;
135135
136+ const ENV_INBOUND_TCP_LISTEN_BACKLOG : & str = "LINKERD2_PROXY_INBOUND_TCP_LISTEN_BACKLOG" ;
137+ const ENV_OUTBOUND_TCP_LISTEN_BACKLOG : & str = "LINKERD2_PROXY_OUTBOUND_TCP_LISTEN_BACKLOG" ;
138+
136139const ENV_INBOUND_MAX_IDLE_CONNS_PER_ENDPOINT : & str = "LINKERD2_PROXY_MAX_IDLE_CONNS_PER_ENDPOINT" ;
137140const ENV_OUTBOUND_MAX_IDLE_CONNS_PER_ENDPOINT : & str =
138141 "LINKERD2_PROXY_OUTBOUND_MAX_IDLE_CONNS_PER_ENDPOINT" ;
@@ -386,6 +389,9 @@ pub fn parse_config<S: Strings>(strings: &S) -> Result<super::Config, EnvError>
386389 let inbound_accept_keepalive = parse ( strings, ENV_INBOUND_ACCEPT_KEEPALIVE , parse_duration) ;
387390 let outbound_accept_keepalive = parse ( strings, ENV_OUTBOUND_ACCEPT_KEEPALIVE , parse_duration) ;
388391
392+ let inbound_tcp_listen_backlog = parse ( strings, ENV_INBOUND_TCP_LISTEN_BACKLOG , parse_number :: < u32 > ) ;
393+ let outbound_tcp_listen_backlog = parse ( strings, ENV_OUTBOUND_TCP_LISTEN_BACKLOG , parse_number :: < u32 > ) ;
394+
389395 let inbound_connect_keepalive = parse ( strings, ENV_INBOUND_CONNECT_KEEPALIVE , parse_duration) ;
390396 let outbound_connect_keepalive = parse ( strings, ENV_OUTBOUND_CONNECT_KEEPALIVE , parse_duration) ;
391397
@@ -499,10 +505,12 @@ pub fn parse_config<S: Strings>(strings: &S) -> Result<super::Config, EnvError>
499505
500506 let keepalive = Keepalive ( outbound_accept_keepalive?) ;
501507 let user_timeout = UserTimeout ( outbound_accept_user_timeout?) ;
508+ let backlog = Backlog ( outbound_tcp_listen_backlog?. unwrap_or ( 128 ) ) ;
502509 let server = ServerConfig {
503510 addr,
504511 keepalive,
505512 user_timeout,
513+ backlog,
506514 http2 : http2:: parse_server ( strings, "LINKERD2_PROXY_OUTBOUND_SERVER_HTTP2" ) ?,
507515 } ;
508516 let discovery_idle_timeout =
@@ -591,10 +599,12 @@ pub fn parse_config<S: Strings>(strings: &S) -> Result<super::Config, EnvError>
591599 ) ;
592600 let keepalive = Keepalive ( inbound_accept_keepalive?) ;
593601 let user_timeout = UserTimeout ( inbound_accept_user_timeout?) ;
602+ let backlog = Backlog ( inbound_tcp_listen_backlog?. unwrap_or ( 128 ) ) ;
594603 let server = ServerConfig {
595604 addr,
596605 keepalive,
597606 user_timeout,
607+ backlog,
598608 http2 : http2:: parse_server ( strings, "LINKERD2_PROXY_INBOUND_SERVER_HTTP2" ) ?,
599609 } ;
600610 let discovery_idle_timeout =
@@ -814,6 +824,7 @@ pub fn parse_config<S: Strings>(strings: &S) -> Result<super::Config, EnvError>
814824 addr : DualListenAddr ( admin_listener_addr, None ) ,
815825 keepalive : inbound. proxy . server . keepalive ,
816826 user_timeout : inbound. proxy . server . user_timeout ,
827+ backlog : inbound. proxy . server . backlog ,
817828 http2 : inbound. proxy . server . http2 . clone ( ) ,
818829 } ,
819830
@@ -868,6 +879,7 @@ pub fn parse_config<S: Strings>(strings: &S) -> Result<super::Config, EnvError>
868879 addr : DualListenAddr ( addr, None ) ,
869880 keepalive : inbound. proxy . server . keepalive ,
870881 user_timeout : inbound. proxy . server . user_timeout ,
882+ backlog : inbound. proxy . server . backlog ,
871883 http2 : inbound. proxy . server . http2 . clone ( ) ,
872884 } ,
873885 } )
0 commit comments