Skip to content

test(storage): scope durable failpoints to the invoking thread - #942

Merged
DecisionNerd merged 1 commit into
mainfrom
fix/941-thread-local-rewrite-failpoint
Aug 25, 2026
Merged

test(storage): scope durable failpoints to the invoking thread#942
DecisionNerd merged 1 commit into
mainfrom
fix/941-thread-local-rewrite-failpoint

Conversation

@DecisionNerd

@DecisionNerd DecisionNerd commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Closes #941.

Summary

  • replace the process-global durable-intent test failpoint with thread-local one-shot state
  • remove the poisonable shared test mutex
  • deterministically prove an unrelated commit cannot steal the injected failure

Validation

  • cargo fmt --all -- --check
  • cargo test -p graphforge-storage --lib durable_rewrite::tests:: -- --test-threads=8 (10 passed)
  • cargo test -p graphforge-storage --lib --no-fail-fast (659 passed, 2 ignored)
  • bazelisk test //crates/graphforge-storage:graphforge_storage_test

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of durable rewrite failure testing.
    • Ensured simulated failures remain isolated between threads and trigger only once.
    • Verified recovery and successful commits after a simulated failure.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 03b67ce5-2199-4c07-b247-c1eca332ddac

📥 Commits

Reviewing files that changed from the base of the PR and between a52d3d1 and acbfb2e.

📒 Files selected for processing (1)
  • crates/graphforge-storage/src/durable_rewrite.rs

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


Walkthrough

The durable-rewrite test failpoint now uses a thread-local, one-shot flag. Tests no longer require a shared mutex. New coverage verifies thread isolation, recovery, and subsequent commit success.

Changes

Durable failpoint isolation

Layer / File(s) Summary
Thread-local failpoint setup
crates/graphforge-storage/src/durable_rewrite.rs
The test failpoint uses a thread-local Cell<bool> and resets after one use. Shared mutex handling was removed.
Isolation and recovery coverage
crates/graphforge-storage/src/durable_rewrite.rs
A reusable staged rewrite helper supports tests for unrelated-thread commits, one-shot failure, durable-state recovery, and later rewrite success.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to acbfb

This localized test-only change scopes durable failpoints to the invoking thread and includes passing validation; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: durable failpoints are scoped to the invoking thread.
Description check ✅ Passed The description states the problem, summarizes the implementation, links issue #941, and lists focused, full-suite, formatting, and Bazel validation. It omits several template checklists, but it provi…
Linked Issues check ✅ Passed The changes satisfy issue #941. They use thread-local one-shot failpoints, remove the shared poisonable mutex, add deterministic thread-isolation and recovery coverage, preserve parallel execution, an…
Out of Scope Changes check ✅ Passed The changes are limited to durable-rewrite test failpoint handling and regression coverage. They match issue #941 and do not include production durable-rewrite behavior, #931 implementation work, retr…
Full details: Description check

Explanation

The description states the problem, summarizes the implementation, links issue #941, and lists focused, full-suite, formatting, and Bazel validation. It omits several template checklists, but it provides the critical review information.

Full details: Linked Issues check

Explanation

The changes satisfy issue #941. They use thread-local one-shot failpoints, remove the shared poisonable mutex, add deterministic thread-isolation and recovery coverage, preserve parallel execution, and report all required test suites as passing.

Full details: Out of Scope Changes check

Explanation

The changes are limited to durable-rewrite test failpoint handling and regression coverage. They match issue #941 and do not include production durable-rewrite behavior, #931 implementation work, retries, or suite serialization.

✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/941-thread-local-rewrite-failpoint

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.97.1)

Clippy execution timed out

Warning

Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption.


Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the core Core source code changes label Aug 25, 2026
@DecisionNerd

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@DecisionNerd
DecisionNerd merged commit 3e5140e into main Aug 25, 2026
21 checks passed
@DecisionNerd
DecisionNerd deleted the fix/941-thread-local-rewrite-failpoint branch August 25, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core source code changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(storage): scope durable-rewrite failpoints to the invoking thread

1 participant