LuciferYang commented on PR #13249:
URL: https://github.com/apache/gravitino/pull/13249#issuecomment-5698311595

   Addressed in a57e76dcf: moved the reflective read of the `hooks` field and 
its null-check inside the `synchronized (ApplicationShutdownHooks)` block, so 
the whole read-modify sequence holds the monitor the JDK's 
`add`/`remove`/`runHooks` use. The read was previously outside the lock, which 
only half-closed the race (a stale map, or an NPE if the JDK nulled the field 
during shutdown). Also replaced the timing-based test with a latch-based one 
that gates on the monitor rather than elapsed time, stable across repeated runs.
   


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