Skip to content

Conversation

hebasto and others added 3 commits December 31, 2025 12:22
@DrahtBot
Copy link
Contributor

DrahtBot commented Jan 2, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage & Benchmarks

For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34192.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK willcl-ark, marcofleon

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

@fanquake fanquake mentioned this pull request Jan 5, 2026
8 tasks
fanquake and others added 4 commits January 5, 2026 11:41
Currently when CTRL-C is pressed and there is an active `waitforblockheight`,
or `waitforblock`, or `waitfornewblock` RPC call, or a mining interface
`waitTipChanged` IPC call with a long timeout, the node will not shut down
right away, and will wait for the timeout to be reached before exiting.

This behavior is not ideal and only happens when the node is stopped with
CTRL-C or SIGTERM. When the node is stopped with `bitcoin-cli stop`, the wait
calls are interrupted and the node does shut down right away.

The next commit improves node behavior. This commit just adds test coverage to
simplify the next commit and clarify the change in behavior there.

Github-Pull: bitcoin#33511
Rebased-From: 6a29f79
Signal m_tip_block_cv when Ctrl-C is pressed or SIGTERM is received, the same
way it is currently signalled when the `stop` RPC is called. This lets RPC
calls like `waitforblockheight` and IPC calls like `waitTipChanged` be
interrupted, instead of waiting for their original timeouts and delaying
shutdown.

Historical notes:

- The behavior where `stop` RPC signals `m_tip_block_cv`, but CTRL-C does not,
  has been around since the condition variable was introduced in bitcoin#30409
  (7eccdaf).
- The signaling was later moved without changing behavior in bitcoin#30967
  (5ca28ef). This commit moves it again to
  the Interrupt() function, which is probably the place it should have been
  added initially, so it works for Ctrl-C shutdowns as well as `stop`
  shutdowns.
- A Qt shutdown bug calling wait methods was fixed previously in bitcoin#18452
  (da73f15), and this change updates that
  fix to avoid the hang happening again in Qt.

Github-Pull: bitcoin#33511
Rebased-From: c25a5e6
Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f22122b

These backports all look good to me 👍🏼

@fanquake fanquake added this to the 30.2 milestone Jan 5, 2026
Copy link
Contributor

@marcofleon marcofleon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f22122b

@fanquake fanquake merged commit e9f73b8 into bitcoin:30.x Jan 5, 2026
20 checks passed
@fanquake fanquake deleted the 30_2_backports branch January 5, 2026 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants