junmuz commented on PR #8268:
URL: https://github.com/apache/paimon/pull/8268#issuecomment-4769917734

   > I found one remaining leak race in `ClientPool.run`. The check at lines 
71-72 is not atomic with returning the borrowed client to the deque: a thread 
can observe `this.clients != null`, then another thread calls `close()`, sets 
`this.clients = null` and drains the deque, and then the first thread executes 
`clients.addFirst(client)` on the old deque. That client was not included in 
the drain and is no longer reachable from the pool, so it is still left 
unclosed. This is the same close-during-action case this PR is trying to 
handle, just with a narrower interleaving. The return-to-pool path and 
`close()` need to be made mutually exclusive, or the code needs a post-add 
closed check/removal that closes the client if the pool was closed concurrently.
   
   @JingsongLi Thanks for the comment. I have tried addressing that.


-- 
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]

Reply via email to