esteban commented on a change in pull request #1858:
URL: https://github.com/apache/hbase/pull/1858#discussion_r436153126



##########
File path: 
hbase-client/src/main/java/org/apache/hadoop/hbase/ipc/NettyRpcConnection.java
##########
@@ -146,45 +163,43 @@ private void established(Channel ch) throws IOException {
   private boolean reloginInProgress;
 
   private void scheduleRelogin(Throwable error) {
+    assert eventLoop.inEventLoop();
     if (error instanceof FallbackDisallowedException) {
       return;
     }
     if (!provider.canRetry()) {
       LOG.trace("SASL Provider does not support retries");
       return;
     }
-    synchronized (this) {
-      if (reloginInProgress) {
-        return;
-      }
-      reloginInProgress = true;
-      RELOGIN_EXECUTOR.schedule(new Runnable() {
+    if (reloginInProgress) {
+      return;
+    }
+    reloginInProgress = true;
+    RELOGIN_EXECUTOR.schedule(new Runnable() {
 
-        @Override
-        public void run() {
-          try {
-            provider.relogin();
-          } catch (IOException e) {
-            LOG.warn("Relogin failed", e);
-          }
-          synchronized (this) {
-            reloginInProgress = false;
-          }
+      @Override
+      public void run() {
+        try {
+          provider.relogin();
+        } catch (IOException e) {
+          LOG.warn("Relogin failed", e);
         }
-      }, ThreadLocalRandom.current().nextInt(reloginMaxBackoff), 
TimeUnit.MILLISECONDS);
-    }
+        eventLoop.execute(() -> {
+          reloginInProgress = false;
+        });
+      }
+    }, ThreadLocalRandom.current().nextInt(reloginMaxBackoff), 
TimeUnit.MILLISECONDS);
   }
 
   private void failInit(Channel ch, IOException e) {
-    synchronized (this) {
-      // fail all pending calls
-      ch.pipeline().fireUserEventTriggered(BufferCallEvent.fail(e));
-      shutdown0();
-      return;
-    }
+    assert eventLoop.inEventLoop();

Review comment:
       Same as @busbey mentioned at L166, asserts are not usually enabled.




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to