-
Notifications
You must be signed in to change notification settings - Fork 0
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
Alive client connections and shutdown sequence #dilemma #1
Comments
First order of business - after shut-down sequence is initiated, reply exclusively with |
The should connection be closed is a grey line anyway - the initial data may be in transit, or it may be being processed by OS and not passed to application yet, or the initial line may be received but not the headers...
What is less clear is for partially incompletely received connections. Also how layered processing [SSL] plays into this. And how to define sufficient reception for processing. |
Status update: |
Fixed in a424791. |
Any connections kept alive in the background will linger and stop server from shutting down on shutdown request.
Current behaviour:
When everything works fine:
When everything stops working fine:
To understand what is happening here's overview of shutdown sequence:
aemons are slayedThe problem is that after step 2 any IO operation is not notified of further progress (this includes connections being accepted, data received or sent, ...). Worseover after step 3, any interaction with IOYengine is UB. And because notifications go through notificers, notificers are never emptied and the system lingers on step 4.
Now, yes, there are 2 problems here - one that requires introducing a block-await in YAsynC IO before step 2 to make sure no IO operations are pending, and the can of worms that previous solution opens...
See, for classical IO operations which are supposed to complete, they can simply be awaited (ex. file IO). For IO operations that are lingering with clearly nothing to do - well, they can clean up close themselves like good bois (ex. listening sockets). But what about connections that are being kept alive..?
The above is made worse by the abstraction distance provided by YAsynC. That yes made cross-platform universal SSL a breeze, not even
taek
can be made aware of the nature of IO resource that it takes.The text was updated successfully, but these errors were encountered: