1996fanrui opened a new pull request, #29053:
URL: https://github.com/apache/flink/pull/29053
## What is the purpose of the change
`RecoveredInputChannel.finishReadRecoveredState()` wrapped
`onRecoveredStateBuffer()` in
`synchronized(receivedBuffers)`, but that method already locks
`receivedBuffers` internally and, when the
queue was empty, calls `notifyChannelNonEmpty()`, which acquires
`inputChannelsWithData` while
`receivedBuffers` is still held. This inverts the task thread's
`inputChannelsWithData -> receivedBuffers`
lock order and can deadlock on the error path (ABBA). Removing the redundant
outer lock restores the correct
order with no behavior change, since `onRecoveredStateBuffer` already
provides the required mutual exclusion.
## Brief change log
- Drop the outer `synchronized(receivedBuffers)` in
`RecoveredInputChannel.finishReadRecoveredState()`.
## Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
The ABBA cycle is an error-path
lock-ordering issue that cannot be reproduced deterministically in a unit
test; `onRecoveredStateBuffer`
retains its internal locking, so behavior is otherwise unchanged.
## 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): no
- Anything that affects deployment or recovery: yes (input channel-state
recovery)
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
- [ ] Yes (please specify the tool below)
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]