Skip to content

Validate resource requests before queueing - #30395

Open
tamird wants to merge 1 commit into
bazelbuild:masterfrom
tamird:tamird/fix-resource-queue-safety
Open

Validate resource requests before queueing#30395
tamird wants to merge 1 commit into
bazelbuild:masterfrom
tamird:tamird/fix-resource-queue-safety

Conversation

@tamird

@tamird tamird commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

A permanently oversized resource request can wait behind worker quota
or resources already in use. A later wake-up can then raise
NOT_ENOUGH_LOCAL_RESOURCE on the releasing or window thread, while the
waiting latch cannot deliver that error to the requesting action.

Validate scaled requests against total capacity during synchronized
initial acquisition, before any transient gate can queue them. Keep
subsequent availability and wake-up checks boolean-only, removing the
obsolete UserExecException plumbing from release, window,
ResourceHandle, and the worker reaper.

A permanently oversized resource request can wait behind worker quota
or resources already in use. A later wake-up then throws on the
releasing or window thread, while the waiting latch cannot deliver that
error.

Validate scaled requests against total capacity during initial
acquisition so the requesting thread receives the existing failure code
and impossible requests never enter the queue. Keep subsequent
availability and wake-up checks boolean-only, removing the obsolete
UserExecException plumbing from release, window, ResourceHandle, and
the worker reaper.
@github-actions github-actions Bot added team-Performance Issues for Performance teams team-Local-Exec Issues and PRs for the Execution (Local) team awaiting-review PR is awaiting review from an assigned reviewer labels Jul 21, 2026
@tamird

tamird commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Extracted from #30310. Strict CPU-load scheduling exposed that a
permanently insufficient request can enter a waiting latch and raise
its resource error only during a later wake-up, which cannot deliver
the failure to the requesting action.

@tamird

tamird commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@bigelephant29 thanks for the reviews. all the PRs you reviewed are still labeled awaiting-review. Are you able to start the process of getting them imported and merged?

@bigelephant29 bigelephant29 added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jul 27, 2026
@bigelephant29

Copy link
Copy Markdown
Contributor

all the PRs you reviewed are still labeled awaiting-review. Are you able to start the process of getting them imported and merged?

I think I only missed the labels for this one. The other ones are correctly labeled.

As for the largest PR, I'll need to find time looping back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally team-Local-Exec Issues and PRs for the Execution (Local) team team-Performance Issues for Performance teams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants