wsry opened a new pull request #17037:
URL: https://github.com/apache/flink/pull/17037
## What is the purpose of the change
Previously, The buffer listeners are not notified when the the local buffer
pool receives available notification from the global pool. This may cause
potential deadlock issue:
1. A LocalBufferPool is created but there is no available buffers in the
global NetworkBufferPool.
2. The LocalBufferPool registers an available buffer listener to the
global NetworkBufferPool.
3. The BufferManager requests buffers from the LocalBufferPool but no
buffer is available. As a result, it registers an available buffer listener to
the LocalBufferPool.
4. A buffer is recycled to the global NetworkBufferPool and the
LocalBufferPool is notified about the available buffer.
5. The LocalBufferPool requests the available buffer from the global
NetworkBufferPool but the registered available buffer listener of BufferManager
is not notified and it can never get a chance to be notified so deadlock occurs.
This patch fixes this issue by guaranteeing that the LocalBufferPool is
initialized with one buffer. With this piece of guaranteed buffer, the
LocalBufferPool will be in the healthy buffer request and recycle loop. Note:
We are not fixing this issue by notifying the buffer listeners when the local
buffer pool receives available notification from the global pool because of the
potential deadlock.
## Brief change log
- Guarantee that the LocalBufferPool is initialized with one buffer.
## Verifying this change
This change added tests.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / **no**)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (yes / **no**)
- The serializers: (yes / **no** / don't know)
- The runtime per-record code paths (performance sensitive): (yes / **no**
/ don't know)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / **no** / don't
know)
- The S3 file system connector: (yes / **no** / don't know)
## Documentation
- Does this pull request introduce a new feature? (yes / **no**)
- If yes, how is the feature documented? (**not applicable** / docs /
JavaDocs / not documented)
--
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]