Improve Teleport reload behavior#37773
Merged
espadolini merged 5 commits intomasterfrom Feb 13, 2024
Merged
Conversation
e77a2ef to
df191fb
Compare
1857176 to
128ede0
Compare
zmb3
approved these changes
Feb 8, 2024
ca93e2a to
882dc84
Compare
EdwardDowling
approved these changes
Feb 9, 2024
Contributor
EdwardDowling
left a comment
There was a problem hiding this comment.
This looks good to me but is not a part of Teleport I am familiar with with.
|
@espadolini See the table below for backport results.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR tweaks some of the Teleport behavior around SIGHUP reloads and forking:
TeleportProcessin the same process)pkill -L -F <pidfile>and greatly reduce the chance that we accidentally send a signal to an unintended processpkill -L -Fon the pidfile rather than relying on the$MAINPIDas detected by systemd: this is needed because the way Teleport forks a new subprocess on HUP to upgrade itself leaves systemd with no way to accurately keep track of what the "main" Teleport process should be, with the end result being that a secondsystemctl reloadwhile the first Teleport process hasn't exited yet is likely to not get directed at the new Teleport process (weirdly enough, after the second SIGHUP systemd seems to reload thePIDFileconfigured in the unit 🤷)WaitForSignalsloop; this prevents the accumulation of zombies while Teleport is gracefully shutting down (possible when reloading more than once, which is plausible with a combination of very long lived sessions and frequent updates)Changelog: improved the stability of Teleport during graceful upgrades