You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ratis.apache.org by GitBox <gi...@apache.org> on 2020/09/28 07:19:05 UTC

[GitHub] [incubator-ratis] szetszwo commented on a change in pull request #206: RATIS-1072: Should not shutdown and re-create channel/stub in GrpcServerProtocolClient when StreamObserver::onError() is called.

szetszwo commented on a change in pull request #206:
URL: https://github.com/apache/incubator-ratis/pull/206#discussion_r495733484



##########
File path: ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
##########
@@ -86,7 +86,12 @@ private GrpcServerProtocolClient getClient() throws IOException {
   }
 
   private synchronized void resetClient(AppendEntriesRequest request, boolean onError) {
-    rpcService.getProxies().resetProxy(getFollowerId());
+    try {
+      rpcService.getProxies().getProxy(getFollowerId()).resetConnectBackoff();

Review comment:
       Use getClient() for rpcService.getProxies().getProxy(getFollowerId()).

##########
File path: ratis-grpc/src/main/java/org/apache/ratis/grpc/server/GrpcLogAppender.java
##########
@@ -86,7 +86,12 @@ private GrpcServerProtocolClient getClient() throws IOException {
   }
 
   private synchronized void resetClient(AppendEntriesRequest request, boolean onError) {
-    rpcService.getProxies().resetProxy(getFollowerId());
+    try {
+      rpcService.getProxies().getProxy(getFollowerId()).resetConnectBackoff();
+    } catch (IOException ie) {
+      LOG.warn(this + ": Failed to reset channel by " + ie);

Review comment:
       Since resetConnectBackoff() won't throw IOException, let's change the error message to
   `
   `      LOG.warn(this + ": Failed to getClient for " + getFollowerId(), ie);




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org