| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ntext Prevents a ReadContext from being closed before all queries have actually started. This extra check is needed now that queries in read-only transactions are started using the background executor when the async API is used.
There was a problem hiding this comment.
This pull request updates the locking mechanism in AbstractReadContext.java by replacing the intrinsic object lock with a ReentrantLock and a Condition variable to manage pending asynchronous operations. It also introduces an AtomicInteger to track pending starts and ensures that the close() method waits for all pending operations to complete. I have reviewed the implementation and agree with the feedback provided regarding a potential resource leak: if the AsyncResultSetImpl constructor throws an exception, the pendingStarts counter will not be decremented, causing the close() method to hang. The suggested fix to wrap the constructor in a try-catch block is necessary to ensure the counter is correctly decremented in failure scenarios.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Prevents a ReadContext from being closed before all queries have actually started. This extra check is needed now that queries in read-only transactions are started using the background executor when the async API is used.
Follow-up for #12715