benoitc / benoitc/livery

Support zero-downtime listener option reloads on an existing bind

Open
#77 0 comments 0 reactions 1 assignee Claimed by @benoitc View on GitHub
Dominant language
Erlang
Stars
56
Forks
2
Avg merge
42m
Merged PRs (30d)
2

Description

### Summary

It would be useful to support replacing listener options on an existing bind without an accept gap, especially for TLS certificate or transport-option changes.

Today a service owns its listen sockets. Starting the replacement first fails with `eaddrinuse`, while stopping or draining the current service first releases the socket but creates a period with no listener.

### Desired behavior

A supported operation could:

1. prepare the replacement listener on the existing address;
2. atomically direct new accepts to it;
3. let connections accepted by the previous listener drain;
4. close the previous listener afterward.

Possible foundations could be explicit listen-socket handoff, pause/resume acceptance while retaining the socket, or documented `SO_REUSEPORT` support where the platform permits it. An in-place TLS-listener option update would also cover the common certificate-rotation case.

The existing `stop_accepting/1` and `drain/2` APIs handle connection draining well, but they close the listener before a same-bind replacement can start.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.