Skip to content

Conversation

@bazel-io
Copy link
Member

This greatly simplifies the code flow. Instead of using volatile and resorting to some very unsavory workarounds, we can simply make sure only one thread is changing state.workerFuture using plain old synchronization, and on memory pressure, make absolutely sure that the state object is cleaned up after we remove it from the central state cache.

This goes against the advice introduced in 8ef0a51; the wording for SkyKeyComputeState#close() has been updated.

Also changed the "retry on cancellation" logic from using recursion to using a while-loop for better clarity around nested finally blocks.

Fixes #22393.

PiperOrigin-RevId: 637975501
Change-Id: Ied43f0310ec8953f4ff1c2712fe07b8ccbd6c184

Commit de4d519

This greatly simplifies the code flow. Instead of using `volatile` and resorting to some very unsavory workarounds, we can simply make sure only one thread is changing `state.workerFuture` using plain old synchronization, and on memory pressure, make absolutely sure that the state object is cleaned up after we remove it from the central state cache.

This goes against the advice introduced in bazelbuild@8ef0a51; the wording for `SkyKeyComputeState#close()` has been updated.

Also changed the "retry on cancellation" logic from using recursion to using a `while`-loop for better clarity around nested `finally` blocks.

Fixes bazelbuild#22393.

PiperOrigin-RevId: 637975501
Change-Id: Ied43f0310ec8953f4ff1c2712fe07b8ccbd6c184
@bazel-io bazel-io requested a review from a team as a code owner May 28, 2024 18:56
@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 May 28, 2024
@keertk keertk requested a review from Wyverald May 28, 2024 18:57
@keertk keertk enabled auto-merge May 28, 2024 18:57
@keertk keertk added this pull request to the merge queue May 28, 2024
Merged via the queue into bazelbuild:release-7.2.0 with commit c6cabd8 May 28, 2024
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label May 28, 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