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] Enforce and await cleanup in StarlarkBaseExternalContext (#22814) #2

Merged
merged 1 commit into from
Jun 20, 2024

Conversation

keertk
Copy link
Collaborator

@keertk keertk commented Jun 20, 2024

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 bazelbuild#22680
Work towards bazelbuild#22748

Closes bazelbuild#22772

PiperOrigin-RevId: 644669599
Change-Id: Ib71e5bf346830b92277ac2bd473e11c834cb2624

Closes bazelbuild#22775

…azelbuild#22814)

`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 bazelbuild#22680
Work towards bazelbuild#22748

Closes bazelbuild#22772

PiperOrigin-RevId: 644669599
Change-Id: Ib71e5bf346830b92277ac2bd473e11c834cb2624

Closes bazelbuild#22775
@keertk keertk merged commit 1287a91 into cp22811-7.2.1 Jun 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants