-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
close listening socket in #stop not to accept new connections anymore #1401
Conversation
@repeatedly can you review this? |
@repeatedly ping? |
With |
Ah, wait. Multi processing patch changes its value to |
@_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? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
One comment. Others are good for me. |
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.