Skip to content

support systemd socket activation - #3587

Merged
GuillaumeGomez merged 3 commits into
rust-lang:mainfrom
syphar:systemd-socket
Oct 7, 2026
Merged

GuillaumeGomez merged 3 commits into
rust-lang:mainfrom
syphar:systemd-socket

Conversation

@syphar

@syphar syphar commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

nginx currently returns 502s during deployments and webserver restarts. Across the last three restart windows, we observed 267–689 connection-refused errors per restart. These occur between the old webserver closing its listener during graceful shutdown and the new process accepting connections.

This PR adds systemd socket activation support to both docs_rs_web and the legacy daemon:

  • systemd opens the TCP listening socket and keeps it open across service restarts.
  • The webserver adopts the inherited socket instead of binding the port itself.
  • New connections queue in the socket backlog while the webserver restarts; existing requests use the current graceful shutdown path.

Without an inherited socket, the webserver binds its configured address as before. Socket activation should prevent these brief connection-refused outages, provided the backlog has capacity and requests stay within proxy timeouts.

I'll work on the server config once this change is deployed.

more info:

@syphar syphar self-assigned this Oct 7, 2026
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Oct 7, 2026
@syphar
syphar marked this pull request as ready for review October 7, 2026 15:45
@syphar
syphar requested a review from a team as a code owner October 7, 2026 15:45
@syphar

syphar commented Oct 7, 2026 •

Copy link
Copy Markdown
Member Author

r? @GuillaumeGomez

@rustbot

This comment was marked as outdated.

@rustbot rustbot assigned GuillaumeGomez and unassigned syphar Oct 7, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member

Thanks!

@GuillaumeGomez
GuillaumeGomez merged commit 345207b into rust-lang:main Oct 7, 2026
13 checks passed
@GuillaumeGomez
GuillaumeGomez deleted the systemd-socket branch October 7, 2026 15:56
@github-actions github-actions Bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Oct 7, 2026
@syphar

syphar commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

ah damn.... I forgot to rebase / rename commits here on this PR, now it's on main 😅

@syphar syphar removed the S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it label Oct 8, 2026
@syphar

syphar commented Oct 8, 2026

Copy link
Copy Markdown
Member Author

I rebased / force-pushed on main to fix the commit

This branch was successfully deployed

1 active deployment
github-pages — 44bae485 Deployed Oct 7, 2026 by GuillaumeGomez via deploy #629
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.

3 participants