-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unset srpm url if all tasks have failed #999
base: master
Are you sure you want to change the base?
Conversation
b1cb97f
to
a0e6467
Compare
alws/crud/build_node.py
Outdated
@@ -896,8 +896,9 @@ async def __update_built_srpm_url( | |||
# if SRPM built we need to download them | |||
# from pulp repos in next tasks | |||
if srpm_artifact and build_task.built_srpm_url is None: | |||
platform_name = (await build_task.awaitable_attrs.platform).name |
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.
Why do we need it?
Also, I think that's a bad idea to access attributes via awaitable_attrs
(see https://docs.sqlalchemy.org/en/20/orm/extensions/asyncio.html#sqlalchemy.ext.asyncio.AsyncAttrs and https://docs.sqlalchemy.org/en/20/orm/extensions/asyncio.html#sqlalchemy.ext.asyncio.AsyncSession.run_sync)
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.
Now I'm not really sure why it was there too :/
BTW, you think that accessing values via awaitable_attrs
is a bad practice or it wouldn't be right in this specific context?
alws/dramatiq/build.py
Outdated
build_task.ts = datetime.datetime.utcnow() | ||
build_task.error = str(e) | ||
build_task.status = BuildTaskStatus.FAILED | ||
await build_node_crud.fast_fail_other_tasks_by_ref(db, build_task) | ||
await db.flush() | ||
|
||
build_id = await _get_build_id(db, request.task_id) |
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.
You can get build_id
from previously loaded build_task
alws/dramatiq/build.py
Outdated
) | ||
) | ||
|
||
await db.flush() |
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.
Can't we check it only once when all build tasks are completed?
Resolves: AlmaLinux/build-system#323