You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/07/29 07:47:28 UTC

[GitHub] [kafka] abbccdda opened a new pull request #9095: KAFKA-10321: fix infinite blocking for global stream thread startup

abbccdda opened a new pull request #9095:
URL: https://github.com/apache/kafka/pull/9095


   In the unit test `shouldDieOnInvalidOffsetExceptionDuringStartup` for JDK 11, we spotted a case where a global stream thread startup would stall if it fails immediately upon the first poll. The reason is that `start()` function only checks whether the thread is *not running*, as it needs to block until it finishes the initialization. However, if the thread transits to `DEAD` immediately, the `start()` call would block forever.
   
   Use the failed unit test to verify it works.
   
   ### 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.

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



[GitHub] [kafka] guozhangwang commented on a change in pull request #9095: KAFKA-10321: fix infinite blocking for global stream thread startup

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on a change in pull request #9095:
URL: https://github.com/apache/kafka/pull/9095#discussion_r462589015



##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStreamThread.java
##########
@@ -173,6 +178,18 @@ public boolean stillRunning() {
         }
     }
 
+    public boolean inErrorState() {
+        synchronized (stateLock) {
+            return state.inErrorState();
+        }
+    }
+
+    public boolean stillInitializing() {
+        synchronized (stateLock) {
+            return !state.isRunning() && !state.inErrorState();

Review comment:
       Why not just `state.CREATED` as we are excluding three out of four states here?




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



[GitHub] [kafka] abbccdda merged pull request #9095: KAFKA-10321: fix infinite blocking for global stream thread startup

Posted by GitBox <gi...@apache.org>.
abbccdda merged pull request #9095:
URL: https://github.com/apache/kafka/pull/9095


   


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



[GitHub] [kafka] abbccdda commented on pull request #9095: KAFKA-10321: fix infinite blocking for global stream thread startup

Posted by GitBox <gi...@apache.org>.
abbccdda commented on pull request #9095:
URL: https://github.com/apache/kafka/pull/9095#issuecomment-665999727






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



[GitHub] [kafka] guozhangwang commented on pull request #9095: KAFKA-10321: fix infinite blocking for global stream thread startup

Posted by GitBox <gi...@apache.org>.
guozhangwang commented on pull request #9095:
URL: https://github.com/apache/kafka/pull/9095#issuecomment-665967044


   LGTM. Please feel free to merge and cherry-pick.


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