Skip to content

[fm] Activate sitrep loader when rendezvous detects a stale sitrep.#10622

Open
mergeconflict wants to merge 1 commit into
mergeconflict/fm-sitrepguardedinsert-support-bundlesfrom
mergeconflict/poke-sitrep-loader-when-stale
Open

[fm] Activate sitrep loader when rendezvous detects a stale sitrep.#10622
mergeconflict wants to merge 1 commit into
mergeconflict/fm-sitrepguardedinsert-support-bundlesfrom
mergeconflict/poke-sitrep-loader-when-stale

Conversation

@mergeconflict

Copy link
Copy Markdown
Contributor

When a SitrepGuardedInsert outcome reports that the executing sitrep is stale, the database already has a newer current sitrep than the one this Nexus has loaded. Poke the fm_sitrep_loader background task so that the newer sitrep is picked up promptly, rather than on the loader's next periodic activation; the loader in turn re-activates rendezvous with the fresh sitrep.

The periodic loader timer already bounded the staleness window, so this is a responsiveness improvement, not a correctness fix.

Suggested by @hawkw in #10533.

When a SitrepGuardedInsert outcome reports that the executing sitrep is
stale, the database already has a newer current sitrep than the one this
Nexus has loaded. Poke the fm_sitrep_loader background task so that the
newer sitrep is picked up promptly, rather than on the loader's next
periodic activation; the loader in turn re-activates rendezvous with the
fresh sitrep.

The periodic loader timer already bounded the staleness window, so this
is a responsiveness improvement, not a correctness fix.

Suggested by @hawkw in review of #10533.
@mergeconflict mergeconflict requested review from hawkw and smklein June 12, 2026 21:48
@mergeconflict mergeconflict self-assigned this Jun 12, 2026
@mergeconflict mergeconflict added this to the 21 milestone Jun 12, 2026
@mergeconflict mergeconflict added the fault-management Everything related to the fault-management initiative (RFD480 and others) label Jun 12, 2026
Comment on lines +586 to +604
/// Asserts that `activator` has been activated, panicking with `msg` if
/// it has not.
///
/// `Activator::activate()` stores a permit synchronously, so by the time
/// a test's activation has completed, the activator is either already
/// activated or never will be; a single poll suffices to tell which.
#[track_caller]
fn assert_activated(activator: &Activator, msg: &str) {
let mut activated = tokio_test::task::spawn(activator.activated());
tokio_test::assert_ready!(activated.poll(), "{}", msg);
}

/// Asserts that `activator` has not been activated, panicking with `msg`
/// if it has. See [`assert_activated`].
#[track_caller]
fn assert_not_activated(activator: &Activator, msg: &str) {
let mut activated = tokio_test::task::spawn(activator.activated());
tokio_test::assert_pending!(activated.poll(), "{}", msg);
}

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.

there's similar code in some other background task tests, IIRC. I wonder if this is worth factoring out --- perhaps as test-only methods on Activator?

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

Labels

fault-management Everything related to the fault-management initiative (RFD480 and others)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants