Skip to content

Conversation

swastik959
Copy link

added timr limit to celery tasks in app.py for around an hour
solves #708

Copy link
Member

@kairoaraujo kairoaraujo left a comment

Choose a reason for hiding this comment

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

Hi @swastik959,

Thank you for your contribution! 🎉

I left a comment for us to elaborate more this PR

@swastik959 swastik959 requested a review from kairoaraujo May 17, 2025 12:40
@swastik959
Copy link
Author

@kairoaraujo I have done the relevant changes as suggested by you please review them

@kairoaraujo kairoaraujo changed the title added timr limit to celery tasks added time limit to celery tasks May 19, 2025
Copy link
Member

@kairoaraujo kairoaraujo left a comment

Choose a reason for hiding this comment

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

I reviewed it and it looks good for repository_service_tuf_worker main tasks.
I just miss the UT for the app.py (see tests/unit/test_app.py)

Please, see my commends about the other tasks

Great work @swastik959



@app.task(serializer="json", queue="rstuf_internals")
@app.task(serializer="json", queue="rstuf_internals" , task_time_limit=TASK_TIME_LIMIT , task_soft_time_limit=TASK_SOFT_TIME_LIMIT)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if we should put the task_[soft]_limit for the bump_online_role right now, for some reasons:

  • It will conflict directly with the BOR_LOCK we have to handle
  • Depending on the number of delegated online roles, it will be a problem
  • Using the same task limit time to the add/remove artifacts tasks

I'm in favor here of filing a new specific issue for adding task time limit for bump_online_roles


@app.task(serializer="json", queue="rstuf_internals")
@app.task(serializer="json", queue="rstuf_internals", task_time_limit=TASK_TIME_LIMIT , task_soft_time_limit=TASK_SOFT_TIME_LIMIT)
Copy link
Member

Choose a reason for hiding this comment

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

(same as _update_online_role)

@@ -130,56 +138,68 @@ def _end_bor_chain_callback(result, start_time: float):
return {"result": result, "execution_time_seconds": total_time}


@app.task(serializer="json", queue="rstuf_internals")
@app.task(serializer="json", queue="rstuf_internals", task_time_limit=TASK_TIME_LIMIT , task_soft_time_limit=TASK_SOFT_TIME_LIMIT)
Copy link
Member

Choose a reason for hiding this comment

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

this task is a chain task from bump_online_roles.
I think we should use the same config here, see my comment on bump_online_roles -- I think it should part of a specific change from there.

@swastik959
Copy link
Author

@kairoaraujo should I just undo the changes in other functions apart from main one ?

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.

2 participants