Closed
Description
[ continued from Issue #17547 ]
TL;DR: abortPendingRead()
is called from finishRequest()
, causing it to abort ongoing reads. This causes deadline_exceeded
errors. finishRequest()
should wait for reads to finish in normal case.
Consider following sequence of events from http.conn.serve()
:
startBackgroundRead()
startsbackgroundRead()
in another goroutine.- Assume that
backgroundRead()
from above step does not finish until after the next step. (Simulated by adding sleep) finishRequest()
called, which callsabortPendingRead()
. abortPendingRead() then proceeds to abort ongoing background reads by setting the read deadline toaLongTimeAgo
. This causes the ongoing reads to reportdeadline_exceeded
.