You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "TimurRakhmatullin86 (via GitHub)" <gi...@apache.org> on 2026/09/25 14:47:54 UTC
[PR] [FLINK-XXXXX] Restore interrupt status in InterruptedException catch blocks [flink]
TimurRakhmatullin86 opened a new pull request, #29295:
URL: https://github.com/apache/flink/pull/29295
## What is the purpose of the change
When catching `InterruptedException`, the interrupt flag on the current thread is cleared by the JVM. Code that catches this exception must restore the flag by calling `Thread.currentThread().interrupt()` before re-throwing, wrapping, or returning. Otherwise, upstream code (callers, thread pools, shutdown hooks) cannot detect that an interrupt occurred, leading to subtle concurrency bugs such as threads failing to shut down gracefully.
This PR audits and fixes all `InterruptedException` catch blocks across `flink-core` and `flink-runtime` where the interrupt status was silently swallowed.
## Brief change log
Add `Thread.currentThread().interrupt()` calls in catch blocks that handle `InterruptedException` across the following modules:
**flink-core**
- `FutureUtils` — split multi-catch to restore interrupt status separately from `ExecutionException`
**flink-runtime — checkpoint / filemerging**
- `BlockingPhysicalFilePool`
**flink-runtime — cluster entrypoint**
- `ClusterEntrypoint`
**flink-runtime — file cache**
- `FileCache`
**flink-runtime — I/O subsystem**
- `AsynchronousBlockReader`
- `AsynchronousBlockWriter`
- `AsynchronousFileIOChannel`
- `IOManagerAsync` (2 locations)
**flink-runtime — network partition**
- `BufferWritingResultPartition`
- `SortMergeResultPartition`
- `DiskTierConsumerAgent` (2 locations)
- `MemoryTierConsumerAgent` (2 locations)
**flink-runtime — iterative processing**
- `BlockingBackChannel`
- `Broker` (2 locations)
- `SerializedUpdateBuffer` (5 locations)
**flink-runtime — network utilities**
- `ConnectionUtils` (3 locations)
**flink-runtime — operators**
- `BatchTask`
- `TempBarrier`
- `ComponentClosingUtils` (3 locations)
- `HashPartition`
- `MutableHashTable` (3 locations)
- `ExternalSorter`
- `LargeRecordHandler`
- `ReaderIterator` (2 locations)
**flink-runtime — security**
- `DefaultDelegationTokenManager`
**flink-runtime — source coordinator**
- `SourceCoordinatorContext`
**flink-runtime — streaming**
- `CollectResultFetcher` (2 locations)
- `StreamIterationTail`
## Verifying this change
This change restores interrupt status propagation and does not alter control flow. Each fix adds a single `Thread.currentThread().interrupt()` call before the existing re-throw, wrap, or return statement. Existing unit and integration tests continue to pass without modification.
## Does this pull request potentially affect one of the following parts?
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): yes (interrupt status restoration adds a single method call in the exceptional path only — no impact on the hot path)
- Anything that affects deployment or recovery: no
- The (broadcasting) state machine: no
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-XXXXX] Restore interrupt status in InterruptedException catch blocks [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #29295:
URL: https://github.com/apache/flink/pull/29295#issuecomment-5834465460
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "46b35680629a3ccc81ce4fee8c20e49c921b6cfa",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "46b35680629a3ccc81ce4fee8c20e49c921b6cfa",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 46b35680629a3ccc81ce4fee8c20e49c921b6cfa UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-XXXXX] Restore interrupt status in InterruptedException catch blocks [flink]
Posted by "TimurRakhmatullin86 (via GitHub)" <gi...@apache.org>.
TimurRakhmatullin86 closed pull request #29295: [FLINK-XXXXX] Restore interrupt status in InterruptedException catch blocks
URL: https://github.com/apache/flink/pull/29295
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org