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

Conversation

bjacklyn
Copy link

Fixed #13985

UiStateTracker can process ActionProgress events after an ActionCompletion event
has been fired. This has the effect of recreating the action object in the activeActions
Map because Map.computeIfAbsent() is being used to retrieve the action.

Therefore, a new method getActionStateIfPresent is created which will return
the action if it exists, otherwise return null, and actionProgress() uses this
method so as to not inadverntantly recreate actions after they have already
completed and been removed from the Map.

UiStateTracker can process ActionProgress events after an ActionCompletion event
has been fired. This has the effect of recreating the action object in the activeActions
Map because Map.computeIfAbsent() is being used to retrieve the action.

Therefore, a new method getActionStateIfPresent is created which will return
the action if it exists, otherwise return null, and actionProgress() uses this
method so as to not inadverntantly recreate actions after they have already
completed and been removed from the Map.
@google-cla google-cla bot added the cla: yes label Sep 21, 2021
Copy link
Member

@coeuvre coeuvre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! I will import the change and fix the tests.

@bazel-io bazel-io closed this in 639f89d Sep 22, 2021
bjacklyn pushed a commit to bjacklyn/bazel that referenced this pull request Nov 24, 2021
Fixed bazelbuild#13985

UiStateTracker can process ActionProgress events after an ActionCompletion event
has been fired. This has the effect of recreating the action object in the activeActions
Map because Map.computeIfAbsent() is being used to retrieve the action.

Therefore, a new method getActionStateIfPresent is created which will return
the action if it exists, otherwise return null, and actionProgress() uses this
method so as to not inadverntantly recreate actions after they have already
completed and been removed from the Map.

Closes bazelbuild#14020.

PiperOrigin-RevId: 398165993
(cherry picked from commit 639f89d)
meteorcloudy pushed a commit that referenced this pull request Nov 25, 2021
Fixed #13985

UiStateTracker can process ActionProgress events after an ActionCompletion event
has been fired. This has the effect of recreating the action object in the activeActions
Map because Map.computeIfAbsent() is being used to retrieve the action.

Therefore, a new method getActionStateIfPresent is created which will return
the action if it exists, otherwise return null, and actionProgress() uses this
method so as to not inadverntantly recreate actions after they have already
completed and been removed from the Map.

Closes #14020.

PiperOrigin-RevId: 398165993
(cherry picked from commit 639f89d)

Co-authored-by: Brandon Jacklyn <brandonjacklyn@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Actions stuck in "active" and thus "[Prepa]"
2 participants