Skip to content

HA: RaftHAServer.stop() and the in-place restart close the Ratis server with no timeout #9561

Closed

Description

@robfrank

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.

Activity

  1. added this to the 26.11.1 milestone on Oct 9, 2026
  2. added
    ha
    on Oct 9, 2026
  3. added
    concurrency
    severity:major
    on Oct 9, 2026
  4. self-assigned this
    on Oct 9, 2026
  5. added
    in progress
    on Oct 9, 2026
  6. added a commit that references this issue on Oct 9, 2026
  7. robfrank commented on Oct 9, 2026

    @robfrank
    CollaboratorAuthor

    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.

  8. removed
    in progress
    on Oct 9, 2026
  9. added a commit that references this issue on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugconcurrencyhaseverity:major

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions