Commit cf3538f
committed
Fix Dataflow legacy worker abort loop thread death issue
Previously, when the service asked the worker to abort, it threw
ReadLoopAbortedException, which extended 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:
1. Changes ReadLoopAbortedException to extend InterruptedIOException
instead of InterruptedException, as it is a logical I/O abort and
should not trigger thread interrupt handling.
2. Hardens DataflowBatchWorkerHarness to throw a RuntimeException
if all worker threads die, ensuring the JVM exits with a non-zero
code so the runner can restart it.
Ref: b/5123666131 parent be50185 commit cf3538f
2 files changed
Lines changed: 3 additions & 1 deletion
File tree
- runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker
- util/common/worker
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | | - | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
0 commit comments