Skip to content

Make daemon_controller's socket ping confirm the connection - #24

Merged
FooBarWidget merged 1 commit into
FooBarWidget:mainfrom
CamJN:patch-2
Nov 1, 2026
Merged

FooBarWidget merged 1 commit into
FooBarWidget:mainfrom
CamJN:patch-2

Conversation

@CamJN

@CamJN CamJN commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

On 2026-11-01 warp macOS CI runners, a non-blocking connect to a closed loopback TCP port completes without an error, even though the socket never becomes connected (after connecting getpeername fails with EINVAL). ping_socket took that as "something is listening", so closed ports looked open.

This broke passenger macOS Nginx integration tests: NginxController#stop waits until the test port stops answering, which never happened, so each test group timed out after 30 seconds. Added diagnostics confirmed that no process was listening on that port and ports that nothing was using behaved the same way. The same ping is used to decide when Passenger Standalone considers its server started.

ping_socket now asks for the peer address before reporting success, and treats ENOTCONN or EINVAL as "not listening".

On 2026-11-01 warp macOS CI runners, a non-blocking connect to a closed loopback TCP port completes without an error, even though the socket never becomes connected (after connecting getpeername fails with EINVAL). ping_socket took that as "something is listening", so closed ports looked open.

This broke passenger macOS Nginx integration tests: NginxController#stop waits until the test port stops answering, which never happened, so each test group timed out after 30 seconds. Added diagnostics confirmed that no process was listening on that port and ports that nothing was using behaved the same way. The same ping is used to decide when Passenger Standalone considers its server started.

ping_socket now asks for the peer address before reporting success, and treats ENOTCONN or EINVAL as "not listening".

Signed-off-by: Camden Narzt <6243207+CamJN@users.noreply.github.com>
@FooBarWidget
FooBarWidget merged commit 13752bd into FooBarWidget:main Nov 1, 2026
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.

2 participants