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

[14.0][IMP] queue_job: automatically update dependent jobs when state changes manually #676

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

QuocDuong1306
Copy link

@QuocDuong1306 QuocDuong1306 commented Aug 1, 2024

Context:

  • If a user explicitly cancels a job, he expects its child jobs to be canceled as well;

  • However if a job fails, child jobs will stay in WAIT_DEPENDENCIES state; an action is expected from user to fix it and job might succeed after being re-queued

Note

  • No need to forward port for the FIX commit, it was fixed already as part of migration to 16.0+ (here)

- an explicit flush is needed or child jobs won't be updated
- no need to forward port, this was fixed already in 16.0+
@OCA-git-bot
Copy link
Contributor

Hi @guewen,
some modules you are maintaining are being modified, check this out!

@@ -308,13 +308,16 @@ def _change_job_state(self, state, result=None):
if state == DONE:
job_.set_done(result=result)
job_.store()
record.env["queue.job"].flush()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this flush necessary? This isn't the code path that was changed.

Copy link
Author

@QuocDuong1306 QuocDuong1306 Aug 6, 2024

Choose a reason for hiding this comment

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

Hello @amh-mw , It demonstrates the need for the flush: if you remove it, newly added tests won't pass:

The parent jobs need to be flushed before updating the child. Like v16 as is (here)

Copy link
Member

@guewen guewen left a comment

Choose a reason for hiding this comment

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

Thanks!

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@simahawk
Copy link
Contributor

simahawk commented Aug 6, 2024

/ocabot merge minor
Merci! :)

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-676-by-simahawk-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 939a98f into OCA:14.0 Aug 6, 2024
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at c5552d5. Thanks a lot for contributing to OCA. ❤️

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

Successfully merging this pull request may close these issues.

5 participants