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
Fix refcounted FD leak in HTTPClient #2483
Conversation
TravisCI fail seems unrelated |
Thanks, this should be the right thing to do in any case and looks like it fixed a serious resource leak. The wrong behavior of |
I've tested it on Fedora Linux 31, kernel 5.8.11-100.fc31.x86_64 |
First I thought it is some problem in ConnectionPool but basically every new HTTP request over HTTPS ended up with connection close, handle leak and new connection. |
This is basically the output of each client request:
And then the leak:
|
…meout. IOMode.once causes the read() to return with IOStatus.wouldBlock immediately, which previously resulted in erroneously reporting WaitForDataStatus.noModeData instead of timeout. See vibe-d/vibe.d#2483
Okay, I've pushed a fix to vibe-core now: vibe-d/vibe-core#232 AFAICS, the keep-alive logic runs smoothly now, except that the retry-loop doesn't really work as intended, as a connection failure will throw an exception, causing the loop to get canceled. |
I've observed that newly added condition
m_conn.waitForDataEx(0.seconds)
returnsnoMoreData
even forEAGAIN
and so leads to disconnects before the new request.But there is still m_stream set (TLS) which were not destroyed and so there is FD refcount leak.
Calling
disconnect
that handles the stream too worked for me.