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

   Fixed #9084
   
   - Replaced separate `hasLoadRole.get()` and `hasLoadRole.set(true)` calls 
with an atomic  
     `hasLoadRole.compareAndSet(false, true)` operation.
   - This makes the check-and-set atomic, ensuring the runnable executes only 
once,  
     even under concurrent invocations.
   - Previously, multiple threads could see `false` and execute the runnable 
simultaneously,  
     causing duplicate executions.
   
   - Added a new unit test: `testLoadRoleRunsOnceEvenWhenInvokedConcurrently`.
   - Verified that the runnable executes only once, even when `loadRole()` is 
called concurrently.
   
   ### Result
   Improved thread-safety of `loadRole()` and prevented race conditions during 
concurrent access.
   


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