You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "dajac (via GitHub)" <gi...@apache.org> on 2023/12/04 14:04:07 UTC

[PR] MINOR: Fix ConsumerNetworkThread shutdown [kafka]

dajac opened a new pull request, #14913:
URL: https://github.com/apache/kafka/pull/14913

   There is a race condition in the shutdown logic. `running` could be set to `true` after `closeInternal` was called.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Fix ConsumerNetworkThread shutdown [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac merged PR #14913:
URL: https://github.com/apache/kafka/pull/14913


-- 
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-unsubscribe@kafka.apache.org

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


Re: [PR] MINOR: Fix ConsumerNetworkThread shutdown [kafka]

Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14913:
URL: https://github.com/apache/kafka/pull/14913#discussion_r1413920570


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerNetworkThread.java:
##########
@@ -78,13 +78,11 @@ public ConsumerNetworkThread(LogContext logContext,
         this.applicationEventProcessorSupplier = applicationEventProcessorSupplier;
         this.networkClientDelegateSupplier = networkClientDelegateSupplier;
         this.requestManagersSupplier = requestManagersSupplier;
+        this.running = true;
     }
 
     @Override
     public void run() {
-        closer.assertOpen("Consumer network thread is already closed");

Review Comment:
   This assertion does not seem really helpful. It seems better to me to only rely on `running`.



-- 
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-unsubscribe@kafka.apache.org

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