Skip to content

fix(pegboard): restore hibernating request ids#4898

Closed
NathanFlurry wants to merge 1 commit intosqlite-soak/configure-guard-timeoutsfrom
05-02-fix_pegboard_restore_hibernating_request_ids
Closed

fix(pegboard): restore hibernating request ids#4898
NathanFlurry wants to merge 1 commit intosqlite-soak/configure-guard-timeoutsfrom
05-02-fix_pegboard_restore_hibernating_request_ids

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 3, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 3, 2026

PR Review: fix(pegboard): restore hibernating request ids

Overview

This PR adds a regression test -- wake_start_clears_previous_sleep_request -- to verify that when an actor wakes from hibernation (LifecycleCommand::Start after handle_stop(ShutdownKind::Sleep)), the sleep_requested flag is properly cleared. The test guards against an actor immediately re-entering sleep on the next sleep-timer evaluation after waking.

Base branch: sqlite-soak/configure-guard-timeouts (not main). The production fix appears to live there (transition_to(LifecycleState::Started) calls ctx.clear_sleep_requested()); this PR contributes only the test.


Observations

Test structure and patterns are consistent. The actor factory, task wiring, and oneshot reply pattern all match established conventions in the file. The _ => {} wildcard arm on ActorEvent is flagged as a violation by CLAUDE.md, but it appears throughout this same test file (lines 108, 302, 350, 428, 881, 1043...), so this follows existing practice. If the project decides to enforce exhaustive matching in tests, this file needs a broader sweep, not a single-PR fix.

PR title vs. test name mismatch. The PR is titled "restore hibernating request ids" but the test is named wake_start_clears_previous_sleep_request and exercises only the boolean flag, not actual hibernating WebSocket connection restoration. It would help to either (a) align the PR title with what the test covers, or (b) add a companion test asserting restore_hibernating_requests is invoked with the correct HibernatingWebSocketMetadata entries when real connections are hibernated before sleep. The existing wake_start_hibernated_does_not_refire_connection_open covers reconnect suppression but not flag-clearing on wake.

Missing: the actual fix diff. The diff is test-only (70 additions, 0 deletions). If clear_sleep_requested() in transition_to() is the fix, a brief note in the PR description confirming it landed in the base branch would help reviewers understand the full change.

sleep_grace_period value. The test sets sleep_grace_period: Duration::from_millis(200) with sleep_grace_period_overridden: true. This is consistent with neighbouring tests but 200 ms could be flaky under CI load.


Verdict

The test is correct, readable, and guards a real edge case. Two actionable items:

  1. Align the PR title with what the test actually exercises, or add a second test verifying hibernating request IDs are re-registered with the engine after wake.
  2. Clarify in the PR description whether the production fix (clear_sleep_requested in transition_to) is in the base branch or added here -- the diff alone is ambiguous.

@NathanFlurry NathanFlurry changed the base branch from sqlite-soak/configure-guard-timeouts to graphite-base/4898 May 4, 2026 03:58
@NathanFlurry NathanFlurry changed the base branch from graphite-base/4898 to main May 4, 2026 03:58
@NathanFlurry NathanFlurry changed the base branch from main to sqlite-soak/configure-guard-timeouts May 4, 2026 04:00
@NathanFlurry
Copy link
Copy Markdown
Member Author

Landed in main via stack-merge fast-forward push. Commits are in main; closing to match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant