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.3.0] Enforce and await cleanup in StarlarkBaseExternalContext #22776

Closed
bazel-io opened this issue Jun 18, 2024 · 6 comments
Closed

[7.3.0] Enforce and await cleanup in StarlarkBaseExternalContext #22776

bazel-io opened this issue Jun 18, 2024 · 6 comments

Comments

@bazel-io
Copy link
Member

Forked from #22772

@bazel-io bazel-io added this to the 7.3.0 release blockers milestone Jun 18, 2024
@bazel-io
Copy link
Member Author

Cherry-pick was attempted but there were merge conflicts in the following file(s). Please resolve manually.

src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java
src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryFunction.java

cc: @bazelbuild/triage

@iancha1992
Copy link
Member

Cherry-pick was attempted but there were merge conflicts in the following file(s). Please resolve manually.

src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryFunction.java

cc: @bazelbuild/triage

cc: @fmeum @Wyverald @meteorcloudy

@fmeum
Copy link
Collaborator

fmeum commented Jun 20, 2024

@iancha1992 This needs #22794, please retry the cherry-pick after that has been merged.

@bazel-io
Copy link
Member Author

Cherry-pick was attempted but there were merge conflicts in the following file(s). Please resolve manually.

src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleExtensionEvalFunction.java
src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkRepositoryFunction.java

cc: @bazelbuild/triage

@iancha1992
Copy link
Member

iancha1992 commented Jun 24, 2024

@fmeum I am still not able to cherry-pick this on my own :(

cc: @bazelbuild/triage

@fmeum
Copy link
Collaborator

fmeum commented Jun 25, 2024

I sent #22883

github-merge-queue bot pushed a commit that referenced this issue Jun 25, 2024
…22883)

`StarlarkBaseExternalContext` now implements `AutoCloseable` and, in
`close()`:
1. Cancels all pending async tasks.
2. Awaits their termination.
3. Cleans up the working directory (always for module extensions, on
failure for repo rules).
4. Fails if there were pending async tasks in an otherwise successful
evaluation.

Previously, module extensions didn't do any of those. Repo rules did 1
and 4 and sometimes 3, but not in all cases.

This change required replacing the fixed-size thread pool in
`DownloadManager` with virtual threads, thereby resolving a TODO about
not using a fixed-size thread pool for the `GrpcRemoteDownloader`.

Work towards #22680
Work towards #22748

Closes #22772.

PiperOrigin-RevId: 644669599
Change-Id: Ib71e5bf346830b92277ac2bd473e11c834cb2624

Closes #22776
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants