Repository navigation
Fix: SIGTERM/SIGINT during a mempool-update borks signal handling requiring SIGKILL to kill process. - #165
Merged
Conversation
A SIGINT/SIGTERM is delivered through the Waiter channel only once. If the wait() that receives it belongs to a caller that logs and swallows errors (e.g. Mempool::update in the main loop while retrying a bitcoind reconnect), the signal is lost: the main loop never stops and the process keeps running until it is SIGKILLed. Store the received termination signal in the Waiter (shared by clones) so that every later wait() fails with ErrorKind::Interrupt immediately.
There was a problem hiding this comment.
🟡 Changes recommended
CI setup still requires the deleted toolchain file and fails before checks run.
1 open finding
What changed in this PR
Addresses #164 by preserving shutdown signals across waiter clones, so a logged mempool-update error cannot discard the shutdown request.
Changes:
- Adds persistent interrupt state and regression tests.
- Corrects the interrupt error message.
- Migrates toolchain configuration to TOML with IDE components.
| File | Description |
|---|---|
| src/signal.rs | Preserves termination signals and tests subsequent waits. |
| src/errors.rs | Fixes a typo in the interrupt message. |
| rust-toolchain.toml | Pins Rust 1.87 and requests development components. |
| rust-toolchain | Removes the legacy toolchain file. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
mononaut
approved these changes
Oct 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #164
Fix from @ZenulAbidin cherry-picked from ZenulAbidin/electrs@84f464d~2...84f464d
Includes a rust-analyzer / rustup fix that makes IDE usage with rust-analyzer much easier.