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

[JUJU-1887] Adds kill delay duration for service shutdown. #190

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

tlm
Copy link
Contributor

@tlm tlm commented Feb 8, 2023

  • This change adds a new key to the Pebble service plan spec called kill-delay. This allows the author of a service definition to control the amount of time Pebble allows before sending SIGTERM and SIGKILL to a process.

  • This change also increases the default duration afforded to pebble for kill-delay from 5s to 25s.

Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Looks good to me overall. Couple of nit comments and a couple of questions.

README.md Outdated Show resolved Hide resolved
internal/daemon/daemon.go Show resolved Hide resolved
internal/overlord/servstate/handlers.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager_test.go Outdated Show resolved Hide resolved
@tlm tlm force-pushed the kill-delay branch 3 times, most recently from ce79b8e to 899dd30 Compare February 9, 2023 04:31
Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

Looks good to me now, thank you!

@paulomach
Copy link

Just passing by to say that's super critical for data platform deployments and we are looking forward to it. 😬

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Looks very nice, Thomas. Quite a few comments here, but almost all of them are cosmetic. Maybe one item worth pondering on.

README.md Outdated Show resolved Hide resolved
internal/plan/plan.go Outdated Show resolved Hide resolved
internal/overlord/servstate/handlers.go Outdated Show resolved Hide resolved
internal/overlord/servstate/handlers.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager_test.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager_test.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager_test.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager_test.go Outdated Show resolved Hide resolved
@beliaev-maksim
Copy link
Member

hi @niemeyer @tlm !
looks like all the comments were addressed, are we good to merge ?

Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

All the logic looks fine, thank you.

Only points remaining are about the tuning of times.

README.md Outdated Show resolved Hide resolved
internal/daemon/daemon.go Show resolved Hide resolved
internal/overlord/servstate/handlers.go Outdated Show resolved Hide resolved
internal/overlord/servstate/manager.go Outdated Show resolved Hide resolved
shortFailWait = 200 * time.Millisecond
shortOkayDelay = 50 * time.Millisecond
shortKillDelay = 100 * time.Millisecond
shortFailDelay = 100 * time.Millisecond
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this changed?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's because the original shortFailWait included both the time from first SIGTERM to SIGKILL and the second wait after that (100+100=200). Now the code is such that "fail delay" only includes that second part (which I think is a bit clearer in any case). So the total wait time here wasn't changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack, thanks.

- This change adds a new key to the Pebble service plan spec called
  kill-delay. This allows the author of a service definition to control
  the amount of time Pebble allows before sending SIGTERM and SIGKILL to
  a process.

- This change also increases the default duration afforded to pebble for
  kill-delay from 5s to 25s.
Copy link
Contributor

@niemeyer niemeyer left a comment

Choose a reason for hiding this comment

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

Thanks for the collaboration here, everyone.

@niemeyer niemeyer merged commit 02d5a32 into canonical:master Mar 3, 2023
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.

7 participants