You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HA: RaftHAServer.stop() and the in-place restart close the Ratis server with no timeout #9561
bugconcurrencyThreading / concurrency / MVCChaHigh availability / replication (Raft)severity:majorA feature is broken or returns wrong results, with no practical workaround
Follow-up of #9556, from its second to-do item: "Check whether the ArcadeDB division close / in-place restart path has a timeout that would turn this hang into a recoverable failure."
Answer: it does not. Both paths call RaftServer.close() with no bound:
RaftHAServer.stop() calls raftServer.close() directly. If that call hangs, the server shutdown hangs, and with it the JVM shutdown hook.
The in-place restart (RaftHAServer.restartRatis..., the oldServer.close() call) bounds only the wait for a close that is already running on another thread (OldRatisServerTermination.awaitCloseInProgress, 30 s). It does not bound its own close(). A hang there holds the recovery lock, so the HealthMonitor can never retry.
The fix for #9556 removes the cause it reported: the eviction thread is stopped before the close, with a bounded 10 s wait (RaftLogCacheEviction.STOP_WAIT_MS). The close that follows is still unbounded, though. Any other Ratis close that never returns (a stuck gRPC termination, a log worker that never drains, or the eviction stop giving up because the write lock is held elsewhere) still hangs the node instead of failing.
Proposal: run the Ratis server close on a dedicated thread, bounded by a timeout. On timeout, log the stuck thread's stack at SEVERE. Then:
stop(): proceed with the rest of the shutdown.
in-place restart: fail this restart attempt, so it counts toward restartFailureCount and the existing escalation. Do not start a second server beside one whose storage may still be locked.
This needs a design decision on what a timed-out close leaves behind (the storage lock file, gRPC ports), so it was kept out of #9556.
Fixed by #9582. RaftHAServer.stop() and the in-place Ratis restart closed the Ratis server with no time limit, so a close that never returned hung the shutdown or the restart. The close now runs on its own thread with a limit set by the new setting arcadedb.ha.ratisCloseTimeoutMs (default 30000 ms; 0 or negative means no limit). When the limit runs out, the stuck stack is logged at SEVERE and the thread is left running rather than interrupted (interrupting is what broke #8898). A stop then carries on with the shutdown; a restart counts as failed, and repeated failures reach the existing retry budget, which stops the node. If a close is already in progress, stop() waits for it instead of starting a second one, which would interrupt it (#8900).
Still open:
RaftClient.close() in stop and in the restart is also called without a limit; whether Ratis bounds it was not checked, and no issue was filed.
The close after an abandoned restart is bounded but has no test at the RaftHAServer level.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
bugconcurrencyThreading / concurrency / MVCChaHigh availability / replication (Raft)severity:majorA feature is broken or returns wrong results, with no practical workaround
Activity
fix(#9561): bound the Ratis server close on stop() and the in-place r…
robfrank commentedon Oct 9, 2026
Fixed by #9582.
RaftHAServer.stop()and the in-place Ratis restart closed the Ratis server with no time limit, so a close that never returned hung the shutdown or the restart. The close now runs on its own thread with a limit set by the new settingarcadedb.ha.ratisCloseTimeoutMs(default 30000 ms; 0 or negative means no limit). When the limit runs out, the stuck stack is logged at SEVERE and the thread is left running rather than interrupted (interrupting is what broke #8898). A stop then carries on with the shutdown; a restart counts as failed, and repeated failures reach the existing retry budget, which stops the node. If a close is already in progress, stop() waits for it instead of starting a second one, which would interrupt it (#8900).Still open:
RaftClient.close()in stop and in the restart is also called without a limit; whether Ratis bounds it was not checked, and no issue was filed.RaftHAServerlevel.❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(#9561): bound the Ratis server close on stop() and the in-place r…