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

close listening socket in #stop not to accept new connections anymore #1401

Conversation

tagomoris
Copy link
Member

This change is revival of #861, to close listening connections in #stop, not to accept connections to tell clients that this node denies incoming data now.

When shared: true, SocketManager in ServerEngine accepts connections. So plugin side cannot control it (this change doesn't affect to SM's behavior).
But it's correct, because other workers may be able to handle connections newly coming.

@tagomoris
Copy link
Member Author

@repeatedly can you review this?

@tagomoris
Copy link
Member Author

@repeatedly ping?

@repeatedly
Copy link
Member

With shared: false, how handle tcp connections in multi processing mode?

@repeatedly
Copy link
Member

Ah, wait. Multi processing patch changes its value to true.

@_server_connections.each do |conn|
conn.close rescue nil
end
def stop
@_server_mutex.synchronize do
@_servers.each do |si|
si.server.detach if si.server.attached?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

server.close calls detach, so it seems redundant.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it by reading code of cool.io, but it's not clear for me.
So, it's worth to write for me.

@repeatedly
Copy link
Member

One comment. Others are good for me.

@tagomoris tagomoris merged commit 46d31ef into master Jan 6, 2017
@tagomoris tagomoris deleted the close-connections-at-stop-not-to-accept-connections-furthermore branch January 6, 2017 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations v0.14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants