fix: handle fork failure gracefully in daemon and forkm.t#64
Draft
toddr-bot wants to merge 1 commit into
Draft
Conversation
CPAN testers v0.52 shows a FAIL on OpenBSD 7.7 (perl 5.40.3 threaded) where forkm.t dies with "Resource temporarily unavailable" due to RLIMIT_NPROC on constrained smoker machines. Two fixes: 1. Daemon.pm ChildFunc(): Replace die with Error() log + return when fork() fails. A temporary resource exhaustion should not crash the entire daemon — the parent closes the client socket and continues accepting new connections. 2. forkm.t: Stop spawning on fork failure instead of dying. Adjust the test plan to match the number of children actually created. Skip the entire test if zero children could be spawned. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Handle fork() failures gracefully instead of crashing.
Why
CPAN testers v0.52 shows a FAIL on OpenBSD 7.7 (perl 5.40.3, threaded) —
forkm.tdies with "Resource temporarily unavailable" when the smoker hits RLIMIT_NPROC. The server alsodies on fork failure, which is wrong for a production daemon: temporary resource exhaustion shouldn't crash the process.How
ChildFunc(): ReplacediewithError()log +returnon fork failure. The parent closes the client socket and continues accepting.skip_allif zero children could be spawned.Testing
skip_allor reduced plan instead of exit code 35🤖 Generated with Claude Code
Quality Report
Changes: 2 files changed, 20 insertions(+), 6 deletions(-)
Code scan: clean
Tests: passed (OK)
Branch hygiene: clean
Generated by Kōan post-mission quality pipeline