Skip to content

Commit 1cf3545

Browse files
authored
Fix Dataflow legacy worker abort loop thread death issue (#38894)
Previously, when the service asked the worker to abort, it threw ReadLoopAbortedException, which extends InterruptedException. MapTaskExecutor caught this and, in an attempt to preserve the interrupted status, set the interrupted bit on the thread. However, since this was a logical abort and not a real thread interrupt, setting the interrupted bit caused subsequent operations on the thread (like the backoff sleep in DataflowBatchWorkerHarness) to immediately fail with InterruptedException, leading to all worker threads dying and the harness hanging. This fix changes the interruption handling in MapTaskExecutor to not set the interrupted bit if it is just rethrowing the InterruptedException. Since we are throwing the exception, we can rely on the caller to set the bit if they swallow it and need to preserve it. Ref: b/512366613
1 parent 8051efc commit 1cf3545

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

  • runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/util/common/worker

runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/util/common/worker/MapTaskExecutor.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ public void execute() throws Exception {
100100
} catch (Exception closeExn) {
101101
exn.addSuppressed(closeExn);
102102
}
103-
if (exn instanceof InterruptedException) {
104-
Thread.currentThread().interrupt();
105-
}
106103
throw exn;
107104
}
108105
}

0 commit comments

Comments
 (0)