-
Notifications
You must be signed in to change notification settings - Fork 189
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
Conversation
This pull request introduces 1 alert when merging ebf403b into 1c921b5 - view on LGTM.com new alerts:
|
a9fc495
to
b1c8a3b
Compare
log = logging.getLogger(__name__) | ||
|
||
|
||
def main(alias: str): |
There was a problem hiding this comment.
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 👍
358ec99
to
bd8738f
Compare
bodhi/server/tasks/__init__.py
Outdated
@@ -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,), |
There was a problem hiding this comment.
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.
d975ae2
to
4f9b93e
Compare
Signed-off-by: Mattia Verga <mattia.verga@tiscali.it>
96a45f1
to
387014a
Compare
FYI I have deployed this on the staging instance |
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. |
Now that koji staging is working again, I see some rawhide updates are getting stuck in pending. |
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()
andset_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