fightBoxing commented on issue #15861:
URL: https://github.com/apache/iceberg/issues/15861#issuecomment-4189055913

   I've submitted a fix for this issue in PR #15894.
   
   **Root Cause:** `BaseLockManager.close()` calls `scheduler.shutdownNow()` on 
the shared static `ScheduledExecutorService` without any reference counting. 
When multiple `InMemoryLockManager` instances exist, one instance's `close()` 
destroys the scheduler for all.
   
   **Fix:** Added an `AtomicInteger` reference counter to `BaseLockManager`. 
Each instance increments the counter on first `scheduler()` access and 
decrements on `close()`. The scheduler is only shut down when the last active 
manager closes (ref count reaches zero).
   
   **Testing:** Added two new test cases:
   - `testClosingOneManagerDoesNotAffectAnother` - verifies closing one manager 
doesn't break another
   - `testClosingAllManagersShutsDownScheduler` - verifies proper cleanup and 
re-creation


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to