Commit ef9510d
authored
@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
1 parent d32777c commit ef9510d
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
464 | 477 | | |
465 | 478 | | |
466 | 479 | | |
| |||
0 commit comments