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

client: skip shutdown delay when tasks already deregistered #25157

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions client/allocrunner/group_service_hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@ func (h *groupServiceHook) PreKill() {
//
// caller must hold h.mu
func (h *groupServiceHook) preKillLocked() {
// Optimization: If this allocation has already been deregistered
// because it ran PostRun hooks, skip shutdown_delay
if h.deregistered && h.delay != 0 {
h.logger.Debug("tasks already deregistered, skipping shutdown_delay")
return
}

// If we have a shutdown delay deregister group services and then wait
// before continuing to kill tasks.
h.deregisterLocked()
Expand Down
Loading