FrankYang0529 commented on code in PR #18945:
URL: https://github.com/apache/kafka/pull/18945#discussion_r1967527438


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:
##########
@@ -1561,28 +1555,25 @@ public void onFailure(RuntimeException e) {
                 }
             } catch (AuthenticationException e) {
                 log.error("An authentication error occurred in the heartbeat 
thread", e);
-                this.failed.set(e);
+                setFailed(e);
             } catch (GroupAuthorizationException e) {
                 log.error("A group authorization error occurred in the 
heartbeat thread", e);
-                this.failed.set(e);
+                setFailed(e);
             } catch (InterruptedException | InterruptException e) {
                 Thread.interrupted();
                 log.error("Unexpected interrupt received in heartbeat thread", 
e);
-                this.failed.set(new RuntimeException(e));
+                setFailed(new RuntimeException(e));
             } catch (Throwable e) {
                 log.error("Heartbeat thread failed due to unexpected error", 
e);
                 if (e instanceof RuntimeException)
-                    this.failed.set((RuntimeException) e);
+                    setFailed((RuntimeException) e);
                 else
-                    this.failed.set(new RuntimeException(e));
+                    setFailed(new RuntimeException(e));
             } finally {
                 log.debug("Heartbeat thread has closed");
-                synchronized (AbstractCoordinator.this) {

Review Comment:
   Added it back.



-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to