Skip to content

feat: parity-db flush on shutdown#886

Merged
gilescope merged 1 commit into
mainfrom
feat/db_shutdown
Mar 10, 2026
Merged

feat: parity-db flush on shutdown#886
gilescope merged 1 commit into
mainfrom
feat/db_shutdown

Conversation

@Klapeyron

@Klapeyron Klapeyron commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR adds drop of parity-db once runner goes out of scope, for instance when SIGINT or SIGTERM is generated:
https://paritytech.github.io/polkadot-sdk/master/sc_cli/struct.Runner.html#method.run_node_until_exit

Before changes:

^C2026-03-09 09:41:11.147 ERROR tokio-runtime-worker sc_service::task_manager: Essential task `txpool-background` failed. Shutting down service.

After changes:

^C2026-03-09 09:41:56.886 ERROR tokio-runtime-worker sc_service::task_manager: Essential task `txpool-background` failed. Shutting down service.
2026-03-09 09:41:56.898 DEBUG ThreadId(26) parity-db: Log worker shutdown
2026-03-09 09:41:56.898 DEBUG ThreadId(25) parity-db: Flush worker shutdown
2026-03-09 09:41:56.898 TRACE ThreadId(24) parity-db: No active reader
2026-03-09 09:41:56.899 DEBUG ThreadId(24) parity-db: End of log
2026-03-09 09:41:56.899 DEBUG ThreadId(24) parity-db: Commit worker shutdown
2026-03-09 09:41:56.898 DEBUG ThreadId(27) parity-db: Cleanup worker shutdown
2026-03-09 09:41:56.899 DEBUG                 main parity-db: Processing leftover commits
2026-03-09 09:41:56.899 TRACE                 main parity-db: No active reader
2026-03-09 09:41:56.899 DEBUG                 main parity-db: End of log
2026-03-09 09:41:56.899 DEBUG                 main parity-db: Flush: Flushing log to disk
2026-03-09 09:41:56.907 DEBUG                 main parity-db: Flush: Flushing log completed
2026-03-09 09:41:56.907 DEBUG                 main parity-db: Enacting log record 1
2026-03-09 09:41:56.907 DEBUG                 main parity-db: Created value table t00-5d
...

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@Klapeyron Klapeyron self-assigned this Mar 9, 2026
@Klapeyron Klapeyron requested a review from a team as a code owner March 9, 2026 08:45
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

kics-logo

KICS version: v2.1.19

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 47
LOW LOW 3
INFO INFO 59
TRACE TRACE 0
TOTAL TOTAL 109
Metric Values
Files scanned placeholder 26
Files parsed placeholder 26
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 11

@gilescope gilescope 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.

I can't see it doing any harm.

@Klapeyron Klapeyron force-pushed the feat/db_shutdown branch 2 times, most recently from ee520c6 to a482f88 Compare March 9, 2026 13:26
@Klapeyron Klapeyron changed the base branch from main to giles-pin-contracts March 9, 2026 13:28
Base automatically changed from giles-pin-contracts to main March 9, 2026 14:33
@gilescope gilescope added this pull request to the merge queue Mar 10, 2026
Merged via the queue into main with commit 1c8279d Mar 10, 2026
34 checks passed
@gilescope gilescope deleted the feat/db_shutdown branch March 10, 2026 12:44
@gilescope gilescope added this to the node-1.0.0 milestone Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants