RFR: 8336384: AbstractQueuedSynchronizer.acquire should cancel acquire when failing due to a LinkageError or other errors [v2]
Alan Bateman
alanb at openjdk.org
Wed Aug 14 07:24:53 UTC 2024
On Tue, 13 Aug 2024 22:03:54 GMT, David Holmes <dholmes at openjdk.org> wrote:
> AFAICS `await` would call the acquire method that was changed here. I know we have issues with OOME and SOE, but these changes admit more general exception possibilities that would seem to undermine the required guarantee. But perhaps a different `acquire` is involved in the `await` case?
The changes here just cancel the attempt to acquire before throwing. There is more to Condition.awaitXXX in that they park until they can acquire, then acquire. So SOE or some other resource error would mean awaitXXX throws without holding the lock. We have done some work to on the virtual thread implementation of LockSupport.park/parkNanos/unpark so they never fail with OOME. There is a bit more to come there but otherwise not clear how to deal with other resource errors.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20548#issuecomment-2288030212
More information about the core-libs-dev
mailing list