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

Split handle_update task into two celery tasks for bugs and testcases #3989

Merged
merged 2 commits into from
May 5, 2020

Conversation

mattiaverga
Copy link
Contributor

This will split the updates_handler celery task in two separate tasks for bugs and testcases, so that we can safely retry to fetch testcase details or work on bugs in case of temporary connection problems.

The other logic behind handling the update is moved in the two methods under Update model that used updates_handler - edit() and set_request() - without too much code duplication (only the test gating check was in common by the two).
We may want to move the greenwave query to a separate celery task also, maybe?

Signed-off-by: Mattia Verga mattia.verga@tiscali.it

@mattiaverga mattiaverga added the WIP Work in progress label Apr 7, 2020
@mattiaverga mattiaverga requested a review from a team as a code owner April 7, 2020 06:51
@mattiaverga mattiaverga linked an issue Apr 7, 2020 that may be closed by this pull request
@lgtm-com
Copy link

lgtm-com bot commented Apr 7, 2020

This pull request introduces 1 alert when merging ebf403b into 1c921b5 - view on LGTM.com

new alerts:

  • 1 for Unused local variable

@mattiaverga mattiaverga force-pushed the handle_update_split branch 2 times, most recently from a9fc495 to b1c8a3b Compare April 13, 2020 08:08
bodhi/server/models.py Outdated Show resolved Hide resolved
bodhi/server/models.py Outdated Show resolved Hide resolved
bodhi/server/tasks/__init__.py Outdated Show resolved Hide resolved
log = logging.getLogger(__name__)


def main(alias: str):
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes this tasks much smaller and nicer 👍

bodhi/server/tasks/work_on_bugs.py Outdated Show resolved Hide resolved
bodhi/server/tasks/work_on_bugs.py Outdated Show resolved Hide resolved
bodhi/server/tasks/work_on_bugs.py Outdated Show resolved Hide resolved
bodhi/server/tasks/work_on_bugs.py Outdated Show resolved Hide resolved
bodhi/server/tasks/work_on_bugs.py Outdated Show resolved Hide resolved
@mattiaverga mattiaverga force-pushed the handle_update_split branch 4 times, most recently from 358ec99 to bd8738f Compare April 18, 2020 12:58
@@ -143,3 +144,23 @@ def tag_update_builds_task(tag: str, builds: typing.List[str]):
log.info("Received an order to tag builds for an update")
_do_init()
main(tag, builds)


@app.task(name="work_on_bugs", autoretry_for=(ExternalCallException,),
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 had to add this ExternalCallException because I think we don't want to keep retrying the task if the update is not found in the database and a generic BodhiException is raised.

@mattiaverga mattiaverga removed the WIP Work in progress label Apr 18, 2020
@mattiaverga mattiaverga force-pushed the handle_update_split branch 3 times, most recently from d975ae2 to 4f9b93e Compare April 19, 2020 07:59
Signed-off-by: Mattia Verga <mattia.verga@tiscali.it>
@mergify mergify bot merged commit 599c195 into fedora-infra:develop May 5, 2020
@cverna
Copy link
Contributor

cverna commented May 5, 2020

FYI I have deployed this on the staging instance

@mattiaverga
Copy link
Contributor Author

I still haven't got the occasion to try the new tasks in staging because Koji staging has been down for a few days.

@cverna
Copy link
Contributor

cverna commented May 11, 2020

I still haven't got the occasion to try the new tasks in staging because Koji staging has been down for a few days.

Yeah I am not sure what is happening there. I have given a try to the new tasks in my vagrant box tho and the tasks triggered correctly.

@mattiaverga
Copy link
Contributor Author

Now that koji staging is working again, I see some rawhide updates are getting stuck in pending.
The builds never goes after pending-signing tag...

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

Successfully merging this pull request may close these issues.

Bugs no longer set to MODIFIED when update is submitted
2 participants