Skip to content

[30.x] Backports#34192

Merged
fanquake merged 9 commits into
bitcoin:30.xfrom
fanquake:30_2_backports
Jan 5, 2026
Merged

[30.x] Backports#34192
fanquake merged 9 commits into
bitcoin:30.xfrom
fanquake:30_2_backports

Conversation

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

DrahtBot commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

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

@willcl-ark willcl-ark left a comment

Copy link
Copy Markdown
Member

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

@marcofleon marcofleon left a comment

Copy link
Copy Markdown
Contributor

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
morozow pushed a commit to morozow/bitcoin_rd that referenced this pull request May 8, 2026
bedc1fb doc: update release notes for v30.x (fanquake)
4413189 test: Avoid hard time.sleep(1) in feature_init.py (MarcoFalke)
39c9e16 init: Signal m_tip_block_cv on Ctrl-C (Ryan Ofsky)
89aaa6f test: Test SIGTERM handling during waitforblockheight call (Ryan Ofsky)
4eeb240 doc: Update OpenBSD Build Guide (Hennadii Stepanov)
539368e doc: update copyright year (fanquake)
b099e98 fuzz: doc: remove any mention to address_deserialize_v2 (brunoerg)
3b27efa guix: reduce allowed exported symbols (fanquake)
46c139e build: Update minimum required Boost version (Hennadii Stepanov)

Pull request description:

  Backports:
  * bitcoin#33511
  * bitcoin#33950
  * bitcoin#34091
  * bitcoin#34107
  * bitcoin#34137
  * bitcoin#34174
  * bitcoin#34182

ACKs for top commit:
  willcl-ark:
    ACK bedc1fb
  marcofleon:
    ACK bedc1fb

Tree-SHA512: a4486d331ce8fef07e611188098a965348cdfb081b81e5a2c700e119b1cf3c28cddbeca883ab512a510f6aaa5fc14bf896f70823fa63afcdd0762d9fbda0118b
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