This patch fix a missing rethrow in `MemorySessionImpl::addOrCleanupIfFail`. As 
noted in the JBS issue, this bug does not affect correctness, but it delays 
error reporting.

Writing a test for this is nearly impossible, given that (a) a memory resource 
created against a closed session would be inaccessible by clients (because the 
session is closed!), and (b) because of the narrow window in which the problem 
might manifest (for this problem to occur, a session state change would have to 
occur between the first state check and when the cleanup action list is 
updated).

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

Commit messages:
 - Add more code comments in `MemorySession::addInternal`
 - Initial push

Changes: https://git.openjdk.java.net/jdk/pull/8917/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8917&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8287430
  Stats: 9 lines in 1 file changed: 3 ins; 0 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8917.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8917/head:pull/8917

PR: https://git.openjdk.java.net/jdk/pull/8917

Reply via email to