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

Bugfix/mitigate some <defunct> processes #316

Merged
merged 4 commits into from Feb 26, 2024

Conversation

wtoorop
Copy link
Member

@wtoorop wtoorop commented Feb 16, 2024

This PR handles two processes causes

  1. Where a TCP session prevents one child to exit quickly, causing the others to become because of the blocking read waiting for QUIT_SYNC_ACK that old-main sends when all the old serve children have exited.
  2. When processes take long to exit they exit after the "reload" process becomes "main" again. In server_main(), the loop starts with reaping exited children, and then a poll or ppoll starts waiting for 60 seconds. If old-main or old server childs took long to exit, they will exit during the 60 seconds poll en become . By changing the wait to 1 second, such processes are reaped at least once a second.

For the case when TCP session holds one server processes alive during a reload.
The others exit and become <defunct> because of a blocking read in
server_reload().
In the server_main(). To reap children that took long to exit and exited after
the initial reaping at the start of the server_main loop.
server.c Outdated Show resolved Hide resolved
Copy link
Member

@wcawijngaards wcawijngaards left a comment

Choose a reason for hiding this comment

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

The code looks good, when a signal comes in during the reload change over ipc, then children are reaped by the reload process. This makes them immediately close down, instead of waiting.

server-count: 5
zonesdir: "."
username: ""
database: ""
Copy link
Contributor

Choose a reason for hiding this comment

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

There's no database anymore. Technically, these aren't required.

@wtoorop wtoorop merged commit ead1fb3 into master Feb 26, 2024
4 checks passed
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.

None yet

3 participants