Skip to content

Conversation

@hawkw
Copy link
Member

@hawkw hawkw commented Nov 20, 2025

@jgallagher points out to me that the SpPoller in MGS' SP metrics module uses a tokio::time::interval with the default MissedTickBehavior, which is Burst. This means that if we miss a one-second polling interval because, say, MGS was busy servicing other requests, or due to the vagaries of host OS scheduling, we'll send a burst of SP metrics requests right after each other. This is probably not the ideal behavior here, since the goal is just to do one poll every second.

Thus, this commit changes the SpPoller's Interval to use the Skip MissedTickBehavior. This way, MGS will perform up to one poll per second, with potential gaps if MGS was too busy to poll the SP within a given second. This seems less overwhelming for the poor service processor network stack, in the case that MGS was delayed.

Fixes #9428

@hawkw hawkw requested a review from jgallagher November 20, 2025 17:46
@hawkw hawkw added the Metrics label Nov 20, 2025
@hawkw hawkw enabled auto-merge (squash) November 20, 2025 18:02
@jgallagher points out to me that the `SpPoller` in MGS' SP metrics
module uses a `tokio::time::interval` with the default
`MissedTickBehavior`, which is [`Burst`]. This means that if we miss a
one-second polling interval because, say, MGS was busy servicing other
requests, or due to the vagaries of host OS scheduling, we'll send a
burst of SP metrics requests right after each other. This is probably
not the ideal behavior here, since the goal is just to do one poll every
second.

Thus, this commit changes the `SpPoller`'s `Interval` to use the
[`Skip`] `MissedTickBehavior`. This way, MGS will perform *up to* one
poll per second, with potential gaps if MGS was too busy to poll the SP
within a given second. This seems less overwhelming for the poor service
processor network stack, in the case that MGS was delayed.

Fixes #9428

[`Burst`]:
https://docs.rs/tokio/latest/tokio/time/enum.MissedTickBehavior.html#variant.Burst
[`Skip`]:
https://docs.rs/tokio/latest/tokio/time/enum.MissedTickBehavior.html#variant.Skip
@hawkw hawkw force-pushed the eliza/unburst-mgs branch from 09c59bb to cfb73a1 Compare November 20, 2025 18:03
@hawkw hawkw merged commit ef9510d into main Nov 20, 2025
16 checks passed
@hawkw hawkw deleted the eliza/unburst-mgs branch November 20, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MGS: SpPoller missed tick behavior should probably not be Burst

3 participants