RFR: 8319928: Exceptions thrown by cleanup actions should be handled correctly [v3]

Jorn Vernee jvernee at openjdk.org
Thu Nov 16 18:34:46 UTC 2023


On Thu, 16 Nov 2023 18:24:44 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> This simplePR tweaks the factory which wraps custom cleanup actions passed to `MemorySegment::reinterpret`, so that any exception thrown by the custom cleanup is swallowed when the arena is closed.
>> 
>> This aligns the behavior of confined/shared session with that of implicit session (as implicit sessions are backed by a `Cleaner`, there is no way for cleanup exception to bubble up).
>
> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address CSR comments

src/java.base/share/classes/jdk/internal/foreign/MemorySessionImpl.java line 266:

> 264:                         pendingException = ex;
> 265:                     } else if (ex != pendingException) {
> 266:                         // note: self-suppression is not supported

Does the current test cover the `ex == pendingException` case?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16619#discussion_r1396165147


More information about the core-libs-dev mailing list