2525import org .slf4j .Logger ;
2626import org .slf4j .LoggerFactory ;
2727
28+ import org .apache .uniffle .common .config .RssClientConf ;
2829import org .apache .uniffle .common .util .GrpcNettyUtils ;
2930
3031public abstract class GrpcClient {
@@ -34,17 +35,33 @@ public abstract class GrpcClient {
3435 protected int port ;
3536 protected boolean usePlaintext ;
3637 protected int maxRetryAttempts ;
38+ protected long rpcRetryBackoffMs ;
3739 protected ManagedChannel channel ;
3840
3941 protected GrpcClient (String host , int port , int maxRetryAttempts , boolean usePlaintext ) {
40- this (host , port , maxRetryAttempts , usePlaintext , 0 , 0 , 0 , -1 );
42+ this (
43+ host ,
44+ port ,
45+ maxRetryAttempts ,
46+ usePlaintext ,
47+ RssClientConf .RPC_RETRY_BACKOFF_MS .defaultValue (),
48+ 0 ,
49+ 0 ,
50+ 0 ,
51+ -1 );
52+ }
53+
54+ protected GrpcClient (
55+ String host , int port , int maxRetryAttempts , boolean usePlaintext , long rpcRetryBackoffMs ) {
56+ this (host , port , maxRetryAttempts , usePlaintext , rpcRetryBackoffMs , 0 , 0 , 0 , -1 );
4157 }
4258
4359 protected GrpcClient (
4460 String host ,
4561 int port ,
4662 int maxRetryAttempts ,
4763 boolean usePlaintext ,
64+ long rpcRetryBackoffMs ,
4865 int pageSize ,
4966 int maxOrder ,
5067 int smallCacheSize ,
@@ -53,6 +70,7 @@ protected GrpcClient(
5370 this .port = port ;
5471 this .maxRetryAttempts = maxRetryAttempts ;
5572 this .usePlaintext = usePlaintext ;
73+ this .rpcRetryBackoffMs = rpcRetryBackoffMs ;
5674
5775 if (nettyEventLoopThreads > 0 ) {
5876 System .setProperty (
@@ -69,9 +87,6 @@ protected GrpcClient(
6987 channelBuilder .usePlaintext ();
7088 }
7189
72- if (maxRetryAttempts > 0 ) {
73- channelBuilder .enableRetry ().maxRetryAttempts (maxRetryAttempts );
74- }
7590 channelBuilder .maxInboundMessageSize (Integer .MAX_VALUE );
7691
7792 channel = channelBuilder .build ();
0 commit comments