-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
std(http/server): close open connections on server close #3679
std(http/server): close open connections on server close #3679
Conversation
Okay after some more thought I think problem described in #3593 is caused by two separate issues:
|
57f01dd
to
29e27a0
Compare
|
29e27a0
to
9ecfbeb
Compare
Let's see, just updated tests |
@bartlomieju Okay I've seen it now (this behaviour:
). It won't stop trying to read requests on a connection until that connection closes... which is entirely in the client's hands. This still isn't necessarily a bad thing since people can implement their own timeouts etc. -- but at the same time there will a natural expectation that the iterators break on server close. Probably the right call to drop connections then 👍. |
Just throwing this out there: an alternative solution would be to provide a separate |
Yes, we discussed that offline, and indeed @nayeemrmn if you'd be interested in implementing that then using Go's approach is encouraged: |
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.
Ooh. Looks like my defs of close()
and shutdown()
were swapped 😅. This change is a proper starting point then.
Due to complaints about ergonomics and because it breaks shebang on linux. This reverts commit 2d5457d. BREAKING CHANGE
Needs more investigation, closing for now |
With #4293 this PR can be moved forward |
@ry please review |
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.
LGTM
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
…no#3679) Due to structure of "Server" for each open connection there's a pending "read" op. Because connection owned by "Server" are not tracked, calling "Server.close()" doesn't close open connections. This commit introduces simple tracking of connections for server and ensures owned connections are closed on "Server.close()".
Fixes #3390
If you call
server.close()
on a server that has pending connections then Deno process won't exit until next request comes over for each connection.This PR ensures that all open connections that server owns get properly closed when server is closed.