Mail delta catch-up fails alone in the 7b merge set #1021

Open
opened 2026-10-03 16:11:39 +00:00 by kayg · 5 comments
Owner

Mail delta catch-up fails alone in the 7b merge set

Found in #867 round 2, job/merge-round-7b2. The focused command is:

CARGO_PROFILE_DEV_DEBUG=line-tables-only CARGO_INCREMENTAL=0 CARGO_BUILD_JOBS=3 cargo test -p calternal-plugin-mail sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes -- --exact --test-threads=4

Verbatim output:

called `Result::unwrap()` on an `Err` value: Transport
failures:
    sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 67 filtered out; finished in 6.72s

The full crate run also fails this test (64 pass, one fail, three ignored). Clippy passes. The test calls the real sync implementation against its controlled fake IMAP server with 8,100 UIDs. The first bounded pass must stop at UID 8,000, then resume. Its assertions are unchanged. Failure is at the first sync_folder unwrap (sync.rs:2203), before the cursor assertions.

Worktree logs: artifacts/round2-mail-delta-alone.log and artifacts/round2-rust-gates/calternal-plugin-mail.test.log. A diagnostic run with the existing classified logging is pending. No origin/dev baseline result is claimed. This is not a SLOW-only finding; the crate gate remains red. Diagnose and fix the integration, then retain the bounded-window regression.

Mail delta catch-up fails alone in the 7b merge set Found in #867 round 2, job/merge-round-7b2. The focused command is: ``` CARGO_PROFILE_DEV_DEBUG=line-tables-only CARGO_INCREMENTAL=0 CARGO_BUILD_JOBS=3 cargo test -p calternal-plugin-mail sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes -- --exact --test-threads=4 ``` Verbatim output: ``` called `Result::unwrap()` on an `Err` value: Transport failures: sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 67 filtered out; finished in 6.72s ``` The full crate run also fails this test (64 pass, one fail, three ignored). Clippy passes. The test calls the real sync implementation against its controlled fake IMAP server with 8,100 UIDs. The first bounded pass must stop at UID 8,000, then resume. Its assertions are unchanged. Failure is at the first sync_folder unwrap (sync.rs:2203), before the cursor assertions. Worktree logs: artifacts/round2-mail-delta-alone.log and artifacts/round2-rust-gates/calternal-plugin-mail.test.log. A diagnostic run with the existing classified logging is pending. No origin/dev baseline result is claimed. This is not a SLOW-only finding; the crate gate remains red. Diagnose and fix the integration, then retain the bounded-window regression.
Author
Owner

Fresh standalone reproduction on 527c7f74: the existing 8,100-UID test fails at the delta window write. A content-safe test diagnostic reports delta_window; the prior isolated run recorded SQLite code 5, database is locked. The sync adapter maps this cache write failure to Transport. The shared retry_sqlite_busy helper is available for whole-transaction retries; I am checking the Notes writer path for the same missing retry.

Fresh standalone reproduction on 527c7f74: the existing 8,100-UID test fails at the delta window write. A content-safe test diagnostic reports delta_window; the prior isolated run recorded SQLite code 5, database is locked. The sync adapter maps this cache write failure to Transport. The shared retry_sqlite_busy helper is available for whole-transaction retries; I am checking the Notes writer path for the same missing retry.
Author
Owner

Update for #1021: the first transaction-retry implementation did not clear the unchanged 8,100-UID regression. It still fails at the delta-window cache write after the bounded retries. I am adding a test-only diagnostic with the fixed SQLite error class and content-free checkpoint counters to identify which lock source remains.

Update for #1021: the first transaction-retry implementation did not clear the unchanged 8,100-UID regression. It still fails at the delta-window cache write after the bounded retries. I am adding a test-only diagnostic with the fixed SQLite error class and content-free checkpoint counters to identify which lock source remains.
Author
Owner

Solo reproduction and fix: the 8,100 UID delta failed while the separate WAL checkpointer was contending with window commits. The first retry policy exhausted its 25 ms + 75 ms backoff during a checkpoint pass (113 ms in the content-free checkpoint status). I increased the shared bounded retry backoff to 50 ms + 250 ms and wrapped Mail's whole idempotent window transaction; arrival events and invalidations remain after the successful commit. The unchanged regression now passes alone: cargo test -p calternal-plugin-mail sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes -- --exact --nocapture — 1 passed, 0 failed (24.95s). I will run the full Mail crate gate with the final per-crate gates.

Solo reproduction and fix: the 8,100 UID delta failed while the separate WAL checkpointer was contending with window commits. The first retry policy exhausted its 25 ms + 75 ms backoff during a checkpoint pass (113 ms in the content-free checkpoint status). I increased the shared bounded retry backoff to 50 ms + 250 ms and wrapped Mail's whole idempotent window transaction; arrival events and invalidations remain after the successful commit. The unchanged regression now passes alone: `cargo test -p calternal-plugin-mail sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes -- --exact --nocapture` — 1 passed, 0 failed (24.95s). I will run the full Mail crate gate with the final per-crate gates.
Author
Owner

Final round-3 verification on the current branch: the previously committed shared BUSY/LOCKED retry for complete idempotent Mail window transactions is present, and the isolated 8,100-UID regression passes with the new content-safe classified failure diagnostic. Focused result: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 67 filtered out; finished in 12.02s.

Final Mail gates:

    Checking calternal-plugin-mail v0.0.1 (/home/kayg/Developer/calternal-wt/merge-round-7b2/crates/plugins/mail)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.75s
test result: ok. 65 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 10.49s

No Mail transaction logic changed in this continuation. Commit 6aa799018 improves the regression failure message without logging provider content.

Final round-3 verification on the current branch: the previously committed shared BUSY/LOCKED retry for complete idempotent Mail window transactions is present, and the isolated 8,100-UID regression passes with the new content-safe classified failure diagnostic. Focused result: `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 67 filtered out; finished in 12.02s`. Final Mail gates: ``` Checking calternal-plugin-mail v0.0.1 (/home/kayg/Developer/calternal-wt/merge-round-7b2/crates/plugins/mail) Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.75s ``` ``` test result: ok. 65 passed; 0 failed; 3 ignored; 0 measured; 0 filtered out; finished in 10.49s ``` No Mail transaction logic changed in this continuation. Commit `6aa799018` improves the regression failure message without logging provider content.
Author
Owner

Merge29j at 01b0d3b94 reproduced the same delta regression in the full Mail crate run. No Mail sync.rs code or assertion changed in this merge set. Mail clippy passed.

Verbatim failure:

first delta pass failed: Transport; classified log:  WARN mail sync step failed step="cache" error_kind="storage"
test result: FAILED. 127 passed; 1 failed; 6 ignored; 0 measured; 0 filtered out; finished in 28.90s

The isolated follow-up retained the real 8,100-UID fixture, UID 8,000 cursor assertion and second-pass completion. It passed with --exact --test-threads=1 --nocapture:

test sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 133 filtered out; finished in 22.85s

A single full crate follow-up is now running with --test-threads=4. No SLOW-only diagnosis is claimed: the captured failure class is storage, and the underlying error is intentionally private. The original failure log is retained for attachment to #1145.

Merge29j at `01b0d3b94` reproduced the same delta regression in the full Mail crate run. No Mail sync.rs code or assertion changed in this merge set. Mail clippy passed. Verbatim failure: ```text first delta pass failed: Transport; classified log: WARN mail sync step failed step="cache" error_kind="storage" test result: FAILED. 127 passed; 1 failed; 6 ignored; 0 measured; 0 filtered out; finished in 28.90s ``` The isolated follow-up retained the real 8,100-UID fixture, UID 8,000 cursor assertion and second-pass completion. It passed with `--exact --test-threads=1 --nocapture`: ```text test sync::tests::delta_catch_up_shares_the_bounded_window_budget_and_resumes ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 133 filtered out; finished in 22.85s ``` A single full crate follow-up is now running with `--test-threads=4`. No SLOW-only diagnosis is claimed: the captured failure class is storage, and the underlying error is intentionally private. The original failure log is retained for attachment to #1145.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/calternal#1021
No description provided.