-
Notifications
You must be signed in to change notification settings - Fork 284
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
Error after server returns connection close #1441
Comments
I can confirm that removing the nginx proxy resolved the issue. I will try fiddling with nginx's settings, as there seems to be going something wrong there. |
I reduced my code to this:
I added Is this normal? Edit: to cause libasync to crash you need to do the |
I keep returning to https://github.com/rejectedsoftware/vibe.d/blob/3d851408a813523b73a003805a58f5c5f14c53aa/source/vibe/core/drivers/libevent2_tcp.d#L191. In my case the I changed the onBioWrite function in openssl.d to not write the closing notification and behold - all is well. Somehow it seems vibe.d is waiting for some event to never happen, or some queue to drain that never does. |
I changed this master...skoppe:ssl-conn-close and it worked for libevent. |
This issue might also explain dlang/dub#760, even though the trace logs seem to indicate something else, but I'll have to double-check. So the problem appears to be that during the active connection close, the connection got reset by the peer before that TLS close notification got delivered (at least for libevent). Due to that, an |
Yep that is correct. |
The reason |
Exactly, that check got introduced to fix #1376. I think there simply needs to be an additional state to keep track of the resumption state of the task. |
What about removing I mean, we are actively closing a connection, that is already closed on the other end. We just need to yield to receive the |
The thing is that there is definitely a bug in the libevent driver, so that has to be fixed anyway. Letting the server do the disconnect would probably still be a good idea, but it would have to be somewhat more complex (i.e. actually wait for the server to close the connection and actively close after a timeout if necessary). I've quickly tested with an additional state, but then I stumbled over another issue involving |
PR #1443 looks like it works. I'll also test that w.r.t. the dub-registry issue. |
will test tomorrow |
test is green |
Using vibe.d 0.7.29 and dmd 2.070
I am writing an adapter to move data from CouchDB into ElasticSearch. There are aroung 600 small databases that I need to move over. CouchDB is behind an nginx proxy with SSL termination.
I have determined that CouchDB sends a
connection:close
response header on api call no. 99 (due to some setting) Then things go haywire.With libevent the app blocks at
res.readJson()
in therequestHttp
. With libasync it fails on the next call to requestHttp with exception sayingSocket operation on nonsocket.
What I think happens is that CouchDB closes the connection, and vibe.d or nginx isn't handling SSL finalizing properly.
This is my course of action:
will try https://ma.ttias.be/enable-keepalive-connections-in-nginx-upstream-proxy-configurations/ as per unexpected client disconnction #1400(didn't do much, although one time I got 299 calls before freezing)I will look in the nginx and couchdb logs.(didn't say much)Here is a log for a correct call (libevent):
Here the failing one (libevent):
and the failing libasync one
The text was updated successfully, but these errors were encountered: