Skip to content

[Bug] SIGTERM/SIGINT during a mempool-update RPC reconnect logs a warning but electrs keeps running indefinitely #164

Open

Description

@orangesurf

reported by @zenul_abidin:matrix.org

I had GPT-6 Astra do a static analysis which it confirmed in local v3.3.0 and mempool commit eda20be with the following summary:

src/signal.rs: Waiter consumes the signal and returns ErrorKind::Interrupt; no persistent shutdown state exists.
src/daemon.rs: reconnect waits propagate that error.
src/new_index/mempool.rs: Mempool::update() wraps it with chain_err().
src/bin/electrs.rs: both initial and periodic mempool-update handlers log and discard all errors, losing the shutdown request.

Activity

  1. orangesurf commented on Oct 15, 2026

    @orangesurf
    ContributorAuthor

    From @zenul_abidin:matrix.org

    The fix is here, rebased on the current mempool branch (eda20be): https://github.com/ZenulAbidin/electrs/tree/fix-sticky-shutdown-signal

    The reproduction is a single script for regtest. It covers both the main-loop and the initial mempool-update paths, and unpatched eda20be hangs in every run: https://github.com/ZenulAbidin/electrs/tree/sigterm-hang-repro/contrib/sigterm-hang-repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions