auth: kill processes nicely - #17873
Open
miodvallat wants to merge 1 commit into
Open
Conversation
miodvallat
force-pushed
the
killing_me_softly
branch
from
August 6, 2026 10:46
397d38a to
8147d4d
Compare
Coverage Report for CI Build 31098565664Coverage increased (+5.6%) to 71.184%Details
Uncovered Changes
Coverage Regressions7158 previously-covered lines in 80 files lost coverage.
Coverage Stats💛 - Coveralls |
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
miodvallat
force-pushed
the
killing_me_softly
branch
from
August 6, 2026 11:45
8147d4d to
ef5b61c
Compare
Habbie
reviewed
Aug 9, 2026
| // Give a few seconds (well, 2) to the process to disappear | ||
| for (unsigned int cycles = 2 * 10; cycles != 0; --cycles) { | ||
| Utility::usleep(100UL * 1000UL); | ||
| if (kill(pid, 0) != 0 && errno == ESRCH) { |
Member
There was a problem hiding this comment.
pdns_control cycle gets the desired ESRCH in 5 to 8 rounds here. pdns_control quit always ends up sending SIGKILL. I am not sure why this is.
Contributor
Author
There was a problem hiding this comment.
Anything particular in your configuration, which could cause the server to take time to exit?
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.
Short description
There used to be a school of thought advocating killing processes with
SIGKILL, so that we can be sure the process gets away. Apparently whoever wrote that code in PowerDNS (in pre-subversion times, therefore before 2002) was a member of that school.This PR replaces the use of
SIGKILLby the use ofSIGTERMfirst, waiting for up to two seconds for the process to have disappeared, and if it hasn't, reluctantly send aSIGKILL.This can't be worse than the current behaviour.
Before, when issueing
pdns_control cycle:With this PR:
Checklist
I have: