Skip to content

sqlite: reject non-positive backup rates - #64893

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:sqlite-backup-settle-rate-0
Aug 8, 2026
Merged

nodejs-github-bot merged 1 commit into
nodejs:mainfrom
trivikr:sqlite-backup-settle-rate-0

Conversation

@trivikr

@trivikr trivikr commented Aug 1, 2026

Copy link
Copy Markdown
Member

Fixes: #64892

Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy no pages. The backup job then continually reschedules itself and the returned promise never settles.

This change requires backup rates to be positive integers to prevent zero-work backup jobs.


Assisted-by: codex:gpt-5.6-sol

Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy
no pages. The backup job then continually reschedules itself and the
returned promise never settles.

Require backup rates to be positive integers to prevent zero-work
backup jobs.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/sqlite

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem. labels Aug 1, 2026
@trivikr trivikr added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 1, 2026
@codecov

codecov Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.15%. Comparing base (8a1ca0f) to head (d666b94).
⚠️ Report is 134 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64893      +/-   ##
==========================================
+ Coverage   90.14%   90.15%   +0.01%     
==========================================
  Files         746      746              
  Lines      242849   242851       +2     
  Branches    45771    45768       -3     
==========================================
+ Hits       218906   218939      +33     
+ Misses      15438    15390      -48     
- Partials     8505     8522      +17     
Files with missing lines Coverage Δ
src/node_sqlite.cc 80.92% <100.00%> (+0.03%) ⬆️

... and 40 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

LGTM

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 2, 2026
@nodejs-github-bot

This comment was marked as outdated.

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@trivikr trivikr added the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 8, 2026
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 8, 2026
@nodejs-github-bot
nodejs-github-bot merged commit f538f11 into nodejs:main Aug 8, 2026
83 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in f538f11

aduh95 pushed a commit that referenced this pull request Aug 13, 2026
Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy
no pages. The backup job then continually reschedules itself and the
returned promise never settles.

Require backup rates to be positive integers to prevent zero-work
backup jobs.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #64893
Fixes: #64892
Reviewed-By: James M Snell <jasnell@gmail.com>
@trivikr
trivikr deleted the sqlite-backup-settle-rate-0 branch August 16, 2026 16:01
aduh95 pushed a commit that referenced this pull request Aug 25, 2026
Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy
no pages. The backup job then continually reschedules itself and the
returned promise never settles.

Require backup rates to be positive integers to prevent zero-work
backup jobs.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #64893
Fixes: #64892
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 pushed a commit that referenced this pull request Aug 27, 2026
Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy
no pages. The backup job then continually reschedules itself and the
returned promise never settles.

Require backup rates to be positive integers to prevent zero-work
backup jobs.

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
Assisted-by: codex:gpt-5.6-sol
PR-URL: #64893
Fixes: #64892
Reviewed-By: James M Snell <jasnell@gmail.com>
hestami-ai pushed a commit to hestami-ai/ai-home-maintenance that referenced this pull request Nov 14, 2026
…n the main line), placed before M0

The machine's Node moved from 24.11.1 to 24.22.3 on 2026-11-13 before any gate step had run on it; TOOLCUR D-11
asks for a dry run in scratch and a floor lane first (DESIGN-toolchain-currency.md:741, :763). The lead then ran
every gate:fast step to its end on 24.22.3 at the main-line tip 4e05ee0 (TURBO_FORCE=true). 9 tests failed, all
passing on the official 24.11.1 and 24.15.0 zips:
  - 8 through the Phase 7 archive: node:sqlite's backup() refuses { rate: -1 } from Node 24.21.0
    (nodejs/node#64893, a fix for the rate-0 hang #64892), and scripts/phase7/run-archive.ts:212 asks it of every
    archived store, so a paid run on this machine would throw at its first archive, after that unit is paid for;
  - 1, REG-F-501's CONTROL: Node 24.22.1's fix for CVE-2026-105481 makes http.Agent check a pooled socket before
    reuse, and an unread close counts, so the control's request goes out on a new connection instead of being reset.
The reset REG-F-501 records is narrowed, not gone, so remedy 1 stays.

The roadmap gains package N0 (section 4, before M0): ONE_STEP_RATE = 2 ** 31 - 1 in run-archive.ts, the CONTROL's two
claims checked apart (still pooled; then reset or a new connection), a test of the one-step property, PQ7-M200
re-anchored, P6K-M1 and P6K-M11 re-measured, and two new ledger entries (TCN0-M1, TCN0-M2). Also: section 0 names N0
first; section 2 records the census; M0 depends on N0; section 5's land order starts with N0 and renumbers the rest
(nothing cites a row number); section 8 item 1 names N0; section 9 item 1 is restated (the census is a gate run on
24.22.3) and item 12 records the process lesson and the lane risks the gate does not exercise; section 10 lists N0
among the roadmap's choices. Citations re-checked against the live files (checkcites2.py: 532 refs, 316 quotes, the
one flag left being section 7's description of the pin before it moved to 56). The working-roadmap count is unchanged
(56; verif/slice-subsumption.test.ts passed, 5 of 5).

The cause of each break was traced to its Node release from the changelogs, the source at each tag and runs on up to
ten official builds (checksums and Authenticode verified), and each result re-checked by a second agent; the record
is in the lead's scratch folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. sqlite Issues and PRs related to the SQLite subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sqlite: backup() never settles when rate is 0

4 participants