KAFKA-7707: remove the code never execute#6002
KAFKA-7707: remove the code never execute#6002huangyiminghappy wants to merge 5 commits intoapache:trunkfrom
Conversation
|
cc @smccauliff |
hachikuji
left a comment
There was a problem hiding this comment.
@huangyiminghappy I'm a little confused why you think it is not possible to have multiple waiters. When we await the condition, the lock is released. Am I missing something?
|
@hachikuji thank you review, may be i missing something,i read the BufferPool,found during the lock,only one thread can run,and one condition can add to the waiters,and during the lock ,the condition is remove by waiters, at this time i think this.waiters.peekFirst() is not required. |
|
@huangyiminghappy The lock will be released when |
thank you,i have not pay attention the moreMemory.await,in deallocate method ,it will signal that notice it may have memory to allocate |
|
@huangyiminghappy Thanks for the response. It sounds like you are convinced that the current implementation works? Shall we close this or do you think there is still an issue? |
thank you ,i close this issue |
in the BufferPool,the waiters is locked by ReentrantLock,and the waiters add Condition all within the lock,and the waiters remove also within the lock.in the waiters there is only one Condition instance.

and in the finally we have remove the waiters's condition,so in the finally, we use the
can modify like
Committer Checklist (excluded from commit message)