-
Notifications
You must be signed in to change notification settings - Fork 180
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
Analysis of EOF Errors with GitHub API (Seems Resolved) #214
Comments
Temporarily disabling the retry layer, and disabling the I hope that this means the Femtocleaner issue should be resolved without the need for keepalive. I still think it would be a good idea to have an optional The Apache HTTP Client has a 30 seconds timeout: https://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e418 ➡️ "POST /gists HTTP/1.1\r\n"
➡️ "Authorization: token 1e2b86bd089b885XXX15f590c196b7\r\n"
➡️ "User-Agent: GitHub-jl\r\n"
➡️ "Host: api.github.com\r\n"
➡️ "Content-Length: 57\r\n"
➡️ "\r\n"
DEBUG: dfce 👁 Start read: T2 🔗 2↑🔒 2↓ api.github.com:443:64132 ≣16 RawFD(23)
➡️ "{\"public\":false,\"files\":{\"f1\":\"foo\"},\"description\":\"foo\"}ERROR: "
EOFError: read end of file
Stacktrace:
[1] readuntil(::HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Parsers.#find_end_of_header) at /Users/sam/.julia/v0.6/HTTP/src/IOExtras.jl:169
[2] readheaders(::HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}, ::HTTP.Messages.Response) at /Users/sam/.julia/v0.6/HTTP/src/Messages.jl:468
[3] startread(::HTTP.Streams.Stream{HTTP.Messages.Response,HTTP.DebugRequest.IODebug{HTTP.ConnectionPool.Transaction{MbedTLS.SSLContext}}}) at /Users/sam/.julia/v0.6/HTTP/src/Streams.jl:146
[4] macro expansion at /Users/sam/.julia/v0.6/HTTP/src/StreamRequest.jl:57 [inlined] |
This is really great analysis/research @samoconnor. Given all this, do you see outstanding action items? Could you make a PR to GitHub.jl introducing the timeout limits? and does that depend on #215 being merged first? It'd be great to get this all squared away and ensure FemtoCleaner.jl is happy again. |
I think this should wait until FemtoCleaner has been used for a while with the changes from the retry_post_requests branch (b24f49a) . If this is stable, then I don't think any further change is needed. If tagging 0.6.6 makes it easier to test FemtoCleaner.jl, then lets do that. I don't think #215 should be merged yet. And unless @vtjnash is happy with the connect timeout implementation I'll remove it before merging. As it is it causes the Julia runtime to hang on exit. |
Hi @Keno, Please let us know if v0.6.6 improves things with FemtoCleaner. |
When a connection is returned to the (read) pool, add a monitor to it for receiving unexpected data (or EOF), and kill / close the Connection object if any activity occurs before the next write (when it should have simply been waiting idle in the pool) per JuliaLang/MbedTLS.jl#145 (comment) closes #214 closes #199 closes #220 closes JuliaWeb/GitHub.jl#106
* ConnectionPool: monitor idle connections When a connection is returned to the (read) pool, add a monitor to it for receiving unexpected data (or EOF), and kill / close the Connection object if any activity occurs before the next write (when it should have simply been waiting idle in the pool) per JuliaLang/MbedTLS.jl#145 (comment) closes #214 closes #199 closes #220 closes JuliaWeb/GitHub.jl#106 * - Encapsulate read|writebusy/sequence/count logic in new isbusy function. - Move close() on eof() || !isbusy() to new monitor_idle_connection function. - Make monitor_idle_connection() a noop for ::Connection{SSLContext} * require Julia 0.6.3 #236 (comment)
Using
verbose=3
andDEBUG_LEVEL=3
.Using the
retry_post_requests
branch (no keepalive) -- note: this branch (and the MbedTLS bug fix the goes with it) is now merged into masterNote that my POST request to GitHub fails with a 404, but this does not effect the test.
The test is trying to observer the behaviour what a POST request is sent on a connection that has been sitting idle for a while. The 404 result is not important.
First request to create a gist, get a response without issue.
^ connection pool shows a single connection that has been used twice (once to get the auth token and once for the POST).
After waiting 10 seconds, the request works as before...
After waiting 30 seconds, the request still works...
After waiting 60 seconds, the connection pool now show the connection in "connected" state rather than "paused" state but I don't think this really tells us anything other than that some local timeout has expired.
When the request is sent this time, it fails with an EOFError.
But, with the changes on the
retry_post_requests
branch, the request is now retried.This means that even with the very tiny POST body used in the test, the connection failure is now detected before the body is sent. I assume that the failure is happening as soon as we try to read the response headers (which now happens before the body is sent).
Now there is a new connection in the pool:
The text was updated successfully, but these errors were encountered: