Skip to content
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

[7.2.1] Ensure that downloads are cancelled on repo rule restart #22758

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

bazel-io
Copy link
Member

When a repository rule is restarted due to memory pressure, all its downloads must be interrupted. While this happened for repository_ctx.download, the download_and_extract method did not register its PendingTask. Since downloads happen on a separate executor, they would continue even through restarts, leading to warnings (see below) or even left over download temp directories.

WARNING: Download from https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.26-aarch64-apple-darwin.tar.gz failed: class java.io.FileNotFoundException /private/var/tmp/_bazel_fmeum/0465a0857e26a35c072f48ab751a1794/external/aspect_bazel_lib~~toolchains~coreutils_darwin_arm64/temp2576567839043404337/coreutils-0.0.26-aarch64-apple-darwin.tar.gz (No such file or directory)

Closes #22748.

PiperOrigin-RevId: 643389876
Change-Id: Ia2cab4b4d73340379c17d4a1e5c327ff43505050

Commit 2fb187f

When a repository rule is restarted due to memory pressure, all its downloads must be interrupted. While this happened for `repository_ctx.download`, the `download_and_extract` method did not register its `PendingTask`. Since downloads happen on a separate executor, they would continue even through restarts, leading to warnings (see below) or even left over download temp directories.

```
WARNING: Download from https://github.com/uutils/coreutils/releases/download/0.0.26/coreutils-0.0.26-aarch64-apple-darwin.tar.gz failed: class java.io.FileNotFoundException /private/var/tmp/_bazel_fmeum/0465a0857e26a35c072f48ab751a1794/external/aspect_bazel_lib~~toolchains~coreutils_darwin_arm64/temp2576567839043404337/coreutils-0.0.26-aarch64-apple-darwin.tar.gz (No such file or directory)
```

Closes bazelbuild#22748.

PiperOrigin-RevId: 643389876
Change-Id: Ia2cab4b4d73340379c17d4a1e5c327ff43505050
@bazel-io bazel-io requested a review from a team as a code owner June 14, 2024 18:05
@bazel-io bazel-io added team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. awaiting-review PR is awaiting review from an assigned reviewer labels Jun 14, 2024
@bazel-io bazel-io requested a review from meteorcloudy June 14, 2024 18:05
@keertk keertk requested a review from Wyverald June 14, 2024 22:32
@meteorcloudy
Copy link
Member

It seems the problem wasn't fixed by this change: #22748 (comment)

We should probably push this back to 7.3 and not block 7.2.1? @fmeum

@fmeum
Copy link
Collaborator

fmeum commented Jun 17, 2024

It's one half of a fix: We also have to wait for the cancelled futures to complete, which ensureNoPendingAsyncTasks doesn't do. I can try to fix that today (and #22680 with it) if 7.2.1 doesn't have to go out just yet. See #22680 (comment), we now have a reliable reproducer.

@meteorcloudy
Copy link
Member

meteorcloudy commented Jun 17, 2024

I see, and #22680 is actually a regression in 7.2.0, then we'll wait for the fix, thanks for looking into it!

@meteorcloudy meteorcloudy enabled auto-merge June 17, 2024 08:23
@meteorcloudy meteorcloudy added this pull request to the merge queue Jun 17, 2024
Merged via the queue into bazelbuild:release-7.2.1 with commit d8cd073 Jun 17, 2024
33 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants