Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why we need fd transfer instead of just create new listener in new process? #427

Open
taikulawo opened this issue Oct 13, 2024 · 2 comments
Labels
question Further information is requested stale

Comments

@taikulawo
Copy link

From my understand, transfer will send fd to new process, let next process continue to drain connections in that fd's backlog.
but If new process use REUSEPORT and then listen, accept, it still can accept connections from kernel socket addr 4 tuple.

Why we need transfer not create?

@eaufavor eaufavor added the question Further information is requested label Oct 14, 2024
@eaufavor
Copy link
Member

eaufavor commented Oct 14, 2024

Good question. Sockets under REUSEPORT have their own listening queues. When closing such a socket (in the old process), all the half-opened TCP connections are dropped. To such connections, the server is offline.

When a listening socket is transferred. It still binds to the same listening queue that old socket binds to. So when the old socket is closed, no connection will be lost.

Copy link

This question has been stale for a week. It will be closed in an additional day if not updated.

@github-actions github-actions bot added the stale label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

2 participants