You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "sjvanrossum (via GitHub)" <gi...@apache.org> on 2026/10/02 12:33:18 UTC

Re: [PR] Restore thread interrupt status in InterruptedException catch blocks [beam]

sjvanrossum commented on code in PR #40275:
URL: https://github.com/apache/beam/pull/40275#discussion_r4165712236


##########
sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaUnboundedReader.java:
##########
@@ -610,6 +610,7 @@ private void consumerPollLoop() {
           commitCheckpointMark();
         } catch (InterruptedException e) {
           LOG.warn("{}: consumer thread is interrupted", this, e); // not expected
+          Thread.currentThread().interrupt();
           break;

Review Comment:
   Note: This block only catches interrupts that did not originate from a Kafka client (preexisting bug).
   Kafka clients do not throw `InterruptedException`, but they may throw their own wrapper exception `InterruptException` instead.
   
   No action required on this PR.
   Just making sure I won't forget to address it later.



-- 
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: github-unsubscribe@beam.apache.org

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