PCloud63514 opened a new pull request, #9146:
URL: https://github.com/apache/gravitino/pull/9146

   ### What changes were proposed in this pull request?
   - Updated TreeLockNode.removeHoldingThreadTimestamp to return a nullable 
Long instead of long.
   - Modified TreeLock.unlock() to handle null timestamps safely before logging.
   - Ensures unlocking works correctly even when the timestamp map is cleared.
   
   ### Why are the changes needed?
   
   - holdingThreadTimestamp is a Map<ThreadIdentifier, Long>, and Map.remove() 
returns null when no timestamp exists.
   - The previous implementation returned long, causing a null → primitive 
unboxing and leading to a NullPointerException.
   - Unlocking a node should not depend on the presence of a timestamp value, 
so the logic must tolerate null entries.
   
   Fix: #9139 
   
   ### Does this PR introduce _any_ user-facing change?
   
   - no.
   - This change only improves internal lock handling and exception safety.
   
   ### How was this patch tested?
   - Verified using the unit test included in the issue 
(testUnlockWithMissingHoldingTimestamp).
   - Confirmed all existing tests continue to pass.
   


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