Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FLINK-18595][network] Fix the deadlock of concurrently recycling buf…
…fer and releasing input channel Assuming two remote channels with buffer managers as listeners in LocalBufferPool, the deadlock happens as follows: 1. While the Canceler thread calling ch1#releaseAllResources, it will occupy bm1's bufferQueue lock and try to call bm2#notifyBufferAvailable. 2. While the task thread recycling exclusive buffer for ch2, then it will occupy bm2's bufferQueue lock and try to call bm1#notifyBufferAvailable. 3. These two threads will both occupy the respective bm's bufferQueue lock and wait for other side's bufferQueue lock to cause deadlock. Regarding the solution, we can check the released state outside of bufferQueue lock in BufferManager#notifyBufferAvailable to return immediately.
- Loading branch information