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

Fix [Prepa] actions stuck in active state #14020

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ private ActionState getActionState(
return activeActions.computeIfAbsent(actionId, (key) -> new ActionState(action, nanoTimeNow));
}

@Nullable
private ActionState getActionStateIfPresent(Artifact actionId) {
return activeActions.get(actionId);
}

void actionStarted(ActionStartedEvent event) {
Action action = event.getAction();
Artifact actionId = action.getPrimaryOutput();
Expand Down Expand Up @@ -586,7 +591,10 @@ void actionProgress(ActionProgressEvent event) {
ActionExecutionMetadata action = event.action();
Artifact actionId = event.action().getPrimaryOutput();
long now = clock.nanoTime();
getActionState(action, actionId, now).onProgressEvent(event, now);
ActionState actionState = getActionStateIfPresent(actionId);
if (actionState != null) {
actionState.onProgressEvent(event, now);
}
}

void actionCompletion(ActionScanningCompletedEvent event) {
Expand Down