Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: finishRequest() aborts ongoing background reads #17559
[ continued from Issue #17547 ]
Consider following sequence of events from
http.response.finishRequest() calls abortPendingRead() which then aborts the background reads. It should not abort background reads, but wait for them to finish. This CL, 1. changes abortPendingRead() to finishPendingRead() with option for aborting. Now for normal requests, it won't abort connections. 2. Sets the Read/Write deadlines for both TLS and TCP connections. Previously, it only set deadlines for TLS leading to deadlocks. These deadlocks went unnoticed because with abortPendingRead() everything was getting aborted all the time. 3. Ensures sensible default timeout values. Fixes golang#17559.