commit | 7272ab269975cb21c6d40988f5db3abac5587069 | [log] [tgz] |
---|---|---|
author | jmmv <jmmv@google.com> | Thu Feb 13 12:30:08 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Feb 13 12:31:11 2020 -0800 |
tree | 71d9e38df2dbc7aa19b4b41ef42383104659f737 | |
parent | d6a7c9cfcdb777bb9dc04482ed8af984fc4ed72d [diff] |
Fix crashes on interrupt due to concurrent sandboxfs requests. When we receive an interrupt, we may still have an ongoing request to sandboxfs to map a sandbox. In that case, attempting to create a request to destroy the sandbox will make us crash due to the sanity-checks we have in RealSandboxfs02Process (and the request will fail anyway if it reaches sandboxfs). Prevent this by tracking whether the sandbox needs cleanup and only issuing the deletion requests if the creation succeeded. Tested: I've tried to write a test for this but it's very difficult. To test this condition, we need to send an interrupt while we have a build with a sandbox creation request in-flight. But to catch the latter, we need the requests to be very big. I've simulated this behavior by adding a sleep in RealSandboxfs02Process#createSandbox and killing Bazel during a build. Would reproduce the crashes instantly before the fix and haven't been able to after this change. RELNOTES: None. PiperOrigin-RevId: 294974301
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md