-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use local_termination_grace_seconds when testing LinuxSandbox availability #18151
Conversation
CC @meisterT |
This whole situation sounds like a dilemma to me. Perhaps we need to take a step back and think about other ways to detect whether sandboxing is available? |
IMHO, some form of timeout is necessary to prevent complete freezes even when we use other ways to detect sandboxes, but simply it should have large enough headroom so that it'd never affect the normal execution paths on properly setup environments. |
If we keep the check as is, then yes we need a timeout and your case shows that it should be higher. However, I was wondering if there is any other way to check whether this check makes sense... |
I agree there could be a way and that'd be cleaner, but this 1s timeout is currently blocking us from upgrading to v6.0+, and I believe this is affecting more users (by occasionally falling back to weaker sandboxes). |
Actually, let's just do the 30s and see if it saves you. It's pretty rare that the check actually hangs and needs the timeout (#15373 is the only case we know of). That said, @sluongng's advice on the bug is valid - your system is in a bad shape if running a no-op command takes >1s. One could argue that the 1s timeout works as a warning that something else needs to be fixed, it's just a pretty obscure warning. |
This might cause Bazel to start up taking up to 30 seconds to complete though. At the very least, switch to use |
My opinion is that this is one of those "user is holding it wrong (because the tool is hard to hold)" kinda case. I object to merging the change as is and I would urge the author to follow my comments at #18071. For this change to merge, I would prefer if we (a) allow the value to be configurable and (b) leave the default value as-is. |
|
@larsrc-google PTAL |
@larsrc-google ping 😃 |
@larsrc-google @sgowroji Thanks! It'd be great if this is taken / backported into 6.x releases. Please let me know if there's anything else I should do. |
Yes, please import it, and if possible backport to the latest 6.X release. |
@bazel-io fork 6.3.0 |
@larsrc-google @sluongng @tsawada |
@iancha1992 For release-6.3.0 we only need to cherry-pick 5cac33f . Please skip 39b7d6d |
…ility A 1s timeout was introduced in checking whether LinuxSandbox is available, to prevent a complete hangup on broken systems. However, it turned out that it occasionally results in misjudging that linux-sandbox being not available. `local_termination_grace_seconds` defaults to 15s, which hopefully gives more headroom and configurability in various setups. Fixes bazelbuild#18071 Closes bazelbuild#18151. PiperOrigin-RevId: 536953768 Change-Id: I5d344ee5bf06cb9b13a2cba9d077f0981f4430a3
…ility (#18568) A 1s timeout was introduced in checking whether LinuxSandbox is available, to prevent a complete hangup on broken systems. However, it turned out that it occasionally results in misjudging that linux-sandbox being not available. `local_termination_grace_seconds` defaults to 15s, which hopefully gives more headroom and configurability in various setups. Fixes #18071 Closes #18151. PiperOrigin-RevId: 536953768 Change-Id: I5d344ee5bf06cb9b13a2cba9d077f0981f4430a3 Co-authored-by: Takeo Sawada <myc.monad@gmail.com>
A 1s timeout was introduced in checking whether LinuxSandbox is available, to prevent a complete hangup on broken systems. However, it turned out that it occasionally results in misjudging that linux-sandbox being not available.
local_termination_grace_seconds
defaults to 15s, which hopefully gives more headroom and configurability in various setups.Fixes #18071