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

As a user, I can specify how long workers should wait during graceful shutdown #6242

Open
bmbouter opened this issue Jan 29, 2025 · 4 comments · May be fixed by #6265
Open

As a user, I can specify how long workers should wait during graceful shutdown #6242

bmbouter opened this issue Jan 29, 2025 · 4 comments · May be fixed by #6265
Assignees
Labels

Comments

@bmbouter
Copy link
Member

See this comment which discusses exposing the TASK_GRACE_INTERVAL as a setting. This is an RFE requesting that.

I don't know how long a heartbeat is so if the setting is expressed in heartbeats (which I think I'm ok with), then I need to know how long that is.

As a user, it would be nicer to me if it was expressable in seconds. For example we also have k8s hard timeout values and those are expressed in seconds, and we need to set these similarly and together, so having them all on a seconds timescale is nicer for me. It'll be ok though if not.

@mdellweg
Copy link
Member

Well heartbeat duration is afaik a setting.
But also this grace time is not a precise time interval. It is measured by counting the ticking by of heartbeats. So the actual resulting time depends on where in the rhythm of the heart an event occured.

If we want more precise timing of stuff we need to rewrite the workers using async python.

@bmbouter
Copy link
Member Author

bmbouter commented Feb 4, 2025

I'm supportive to position the setting as a number of heartbeats and not "a specific number of seconds" if that makes it easier.

@mdellweg
Copy link
Member

mdellweg commented Feb 6, 2025

I think specifying seconds is fine. We just need to document that it's not a precise measure.

@mdellweg
Copy link
Member

mdellweg commented Feb 6, 2025

I just saw, that on sending SIGTERM or SIGHUP the current task should be awaited forever.
Only on SIGINT it will be killed after a grace time. (The second SIGINT will kill the task immediately.)

@mdellweg mdellweg self-assigned this Feb 6, 2025
mdellweg added a commit to mdellweg/pulpcore that referenced this issue Feb 6, 2025
The new setting is measured in seconds. Also added some clarification
around graceful shutdown.

fixes pulp#6242
@mdellweg mdellweg linked a pull request Feb 6, 2025 that will close this issue
mdellweg added a commit to mdellweg/pulpcore that referenced this issue Feb 6, 2025
The new setting is measured in seconds. Also added some clarification
around graceful shutdown.

fixes pulp#6242
mdellweg added a commit to mdellweg/pulpcore that referenced this issue Feb 6, 2025
The new setting is measured in seconds. Also added some clarification
around graceful shutdown.

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

Successfully merging a pull request may close this issue.

3 participants