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: do not try to update actionset state when publishing artifacts #2883

Merged
merged 2 commits into from
May 22, 2024

Conversation

hairyhum
Copy link
Contributor

@hairyhum hairyhum commented May 10, 2024

Change Overview

If there are multiple actions running in parallel, they will populate artifacts while another action is still running.
This causes a conflict in update of actionset state.

Actionset state should be updated only when all actions complete

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@infraq infraq added this to In Progress in Kanister May 10, 2024
@hairyhum hairyhum marked this pull request as draft May 10, 2024 19:56
@hairyhum hairyhum force-pushed the fix-artifacts-publishing-parallel-actions branch 2 times, most recently from 624e5d9 to 15ea80f Compare May 13, 2024 21:26
If there are multiple actions running in parallel, they will populate
artifacts while another action is still running.
This causes a conflict in update of actionset state.

Actionset state should be updated by separate function maybeSetActionSetStateComplete

Fixes #2882
@hairyhum hairyhum force-pushed the fix-artifacts-publishing-parallel-actions branch from 15ea80f to 14a8814 Compare May 13, 2024 21:33
@hairyhum hairyhum marked this pull request as ready for review May 15, 2024 05:09
@hairyhum
Copy link
Contributor Author

TOOD: add tests

for _, p := range as.Phases {
if p.State != crv1alpha1.StateComplete {
log.WithContext(ctx).Print(
"Finished action, but other action's phase is still running. Not setting state to complete.",
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a question about this, in the PR desc also it's mentioned that Actionset state should be updated only when all actions complete by onUpdateActionSet.

What I am not able to understand is, the relation between two actions.
Finished action, but other action's phase is still running. if backup action is complete should it not be marked complete? Which other action would be wait for before marking backup action to be complete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping we can make it work on onUpdateActionSet, but there are unresolved races there. I will change the description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if backup action is complete should it not be marked complete

There is no status per action, adding which would be a bigger change than a bugfix. We have status per phase and per actionset currently. So we can't mark an action to be complete (which would make things a bit easier TBH).

Copy link
Contributor

@PrasadG193 PrasadG193 left a comment

Choose a reason for hiding this comment

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

LGTM

Kanister automation moved this from In Progress to Reviewer approved May 22, 2024
@pavannd1 pavannd1 added the kueue label May 22, 2024
@mergify mergify bot merged commit b3019e0 into master May 22, 2024
15 checks passed
Kanister automation moved this from Reviewer approved to Done May 22, 2024
@mergify mergify bot deleted the fix-artifacts-publishing-parallel-actions branch May 22, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

[BUG] ActionSet artifacts fail to populate in multi-action actionsets
4 participants