Repository navigation
Interval for keepalives - #2305
Conversation
|
/build-image |
|
/build-image nativelink-worker-init |
|
Image built and pushed! |
|
Image built and pushed! |
That's not good. Once soak tested, we can merge it. Maybe share this image with the users to get their opinion? I'm worried about it becoming to chatty. Another thought is I don't like how duration here is |
|
That said, |
I think Skip is the right behaviour. See https://docs.rs/tokio/latest/tokio/time/enum.MissedTickBehavior.html#variant.Skip but my reading of that is that is that Skip does one immediately after a delay, and then resets to the cadence we want v.s. say Burst that would try and catchup with many of them which doesn't feel needed? Delay might even be the right answer, as keepalives need the interval between them not the actual number of them to be preserved. |
chrisstaite-menlo
left a comment
There was a problem hiding this comment.
@chrisstaite-menlo reviewed 1 file and made 1 comment.
Reviewable status:complete! 1 of 1 LGTMs obtained, and all files reviewed.
|
Hmm. Except I'm still seeing weird numbers. I ran a test with this image, and the timeout set to 30s, and got the following diffs between keepalives Note most of them are stable around the expected 15s mark, but then you get a slight drift to 17 and then a 31! I need to investigate this further. |
|
@palfrey is this related to |
8804b8b to
a959a06
Compare
|
/build-image nativelink-worker-init |
|
/build-image |
a959a06 to
faac31f
Compare
I don't think so, as the conversion from f32 -> Duration will occur once, and that seems to be getting a good number to begin with. I've made a change to do the |
|
Image built and pushed! |
|
Image built and pushed! |
|
/build-image nativelink-worker-init |
|
/build-image |
|
Image built and pushed! |
|
Image built and pushed! |
|
I don't think the |
I've tried a few variants of this, and it seems to break various of the other worker tests ( |
|
Previously, palfrey (Tom Parker-Shemilt) wrote…
I don't see how this is different to |
2a13885 to
73b40d3
Compare
palfrey
left a comment
There was a problem hiding this comment.
@palfrey made 1 comment.
Reviewable status: 1 of 1 LGTMs obtained, and 0 of 12 files reviewed, and pending CI: Redis store tester, macos-26, ubuntu-24.04, integration-tests, ubuntu-24.04 / stable, windows-2022 / stable, pre-commit-checks, Analyze (javascript-typescript), Analyze (python), Coverage, Publish image, Publish nativelink-worker-init, Publish nativelink-worker-lre-cc, Publish nativelink-worker-lre-rs, Web Platform Deployment / macos-26, Web Platform Deployment / ubuntu-24.04, Local / lre-cc / ubuntu-24.04, Local / lre-rs / macos-26, Local / lre-rs / ubuntu-24.04, Bazel Dev / macos-26, Bazel Dev / ubuntu-24.04, Cargo Dev / macos-26, Cargo Dev / ubuntu-24.04, Installation / macos-26, Installation / ubuntu-24.04, buck2, buildstream, mongo, rbe-toolchain, asan / ubuntu-24.04, CodeQL, and 1 discussions need to be resolved.
nativelink-worker/src/local_worker.rs line 200 at r6 (raw file):
Previously, chrisstaite-menlo (Chris Staite) wrote…
I don't see how this is different to
drop(spawn!(...).await);
I'm pretty sure I did this before, and it didn't work. And now I've tried it again and it works. sigh
chrisstaite-menlo
left a comment
There was a problem hiding this comment.
@chrisstaite-menlo resolved 1 discussion.
Reviewable status: 1 of 1 LGTMs obtained, and 0 of 12 files reviewed, and pending CI: macos-26, ubuntu-24.04, integration-tests, ubuntu-24.04 / stable, windows-2022 / stable, Coverage, Publish image, Publish nativelink-worker-init, Publish nativelink-worker-lre-rs, Web Platform Deployment / macos-26, Web Platform Deployment / ubuntu-24.04, Local / lre-rs / macos-26, Bazel Dev / macos-26, Bazel Dev / ubuntu-24.04, Cargo Dev / macos-26, Cargo Dev / ubuntu-24.04, Installation / macos-26, Installation / ubuntu-24.04, buck2, buildstream, mongo, rbe-toolchain, asan / ubuntu-24.04.
|
I love you both and both of your work, but "it works in tests" is not quite sufficient for this issue IMHO. A silently dropped keepalive task is exactly the failure mode you're trying to prevent. I like the new edit |
|
|
* Interval for keepalives * Upgrade tokio to 1.52.2 * Actually spawn the keep alive
Description
Worker keepalive should be happening every timeout/2, but we were doing this with
tokio::time::sleepand if the actual keep alive takes more than a trivial amount of time (e.g. because the worker is busy with a job) then sometimes these can drift. Example log:(actual job truncated for readability)
Note how the first few keepalives after the job are still at 2.5s intervals (using default 5s spacing), but then they start to drift and the 09:03:15-19 gap is 4s, which is still ok enough, but then the 19-26 gap is 7s which is enough for the scheduler to timeout the worker.
This PR does three things:
tokio::time::intervalto explicitly do keep alives every timeout/2 (or as close as possible) even if the individual ones take a few secondsI previously had a test case that reliably drifted anywhere up to 106% extra time (31s v.s. 15s) and now drifts only up to ~2% (15.3s max in my most recent run vs. 15s).
Type of change
Please delete options that aren't relevant.
How Has This Been Tested?
bazel test //...and manual testing with the imageChecklist
bazel test //...passes locallygit amendsee some docsThis change is