Closed
Conversation
Detect $ENV{SERVER_STARTER_PORT} automatically at startup. Parse the
env var to extract address and file descriptor (supports host:port=fd,
port=fd, /path=fd, and [ipv6]:port=fd formats).
When Server::Starter is detected:
- Reuse the inherited socket FD instead of binding a new socket
- Reject explicit host/port options (mutual exclusivity)
- For SSL, use per-connection SSL_upgrade pattern
- Preserve socket FD on shutdown (Server::Starter owns it)
- Show "server-starter" in startup log
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In multi-worker mode with SERVER_STARTER_PORT, reuse the inherited FD as the shared listen socket instead of creating a new one. Skip reuseport probe. Workers receive the socket via fork inheritance and don't re-detect the env var. Shutdown guard prevents closing the Server::Starter socket. Startup log shows "server-starter" mode string. Also pass access_log_format to worker server instances. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add SERVER::STARTER INTEGRATION section to Server.pm POD covering: - How the automatic detection works - Usage with start_server command - Constraints (mutual exclusivity with host/port, socket ownership) - Relevant environment variables Add SERVER::STARTER section to bin/pagi-server with usage examples. Add SERVER_STARTER_PORT and SERVER_STARTER_GENERATION to ENVIRONMENT. Add note to host/port constructor docs about Server::Starter override. 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.
Summary
$ENV{SERVER_STARTER_PORT}for zero-downtime binary upgrades via Server::Starterhost/portoptionsStacked on #38 (access log format) — merge that first, then rebase this onto main.
Test plan
prove -l t/45-server-starter.t— 10 subtests: address parser (host:port, port-only, unix path, IPv6, multiple entries), single-worker integration, mutual exclusivity with host/port, shutdown FD preservation, multi-worker integrationprove -l t/— full test suite (no regressions)start_server --port 5000 -- perl -Ilib bin/pagi-server ./examples/01-hello-http/app.pl🤖 Generated with Claude Code