Skip to content

Commit

Permalink
Fix HTTP1.1 pipeline teardown
Browse files Browse the repository at this point in the history
The teardown can be triggered by a connection close of the remote side.
This sends a `LAST` at the bottom of the supply pipeline. That last needs
to bubble up the supply chain and arrive in Cro::HTTP::Client (possibly
also applies to the server) for it to tear down its pipeline. Otherwise the
supply chain will for the most part be torn down and further emits of
requests will sit forever in the topmost Supply::Preserving which then has
no taps.
The symptom without this fix is that a pipeline that the remote end closed
(i.e. hasn't been used for 60 seconds or so) will cause all subsequent uses
of that pipeline to error out with

    Exceeded timeout for headers when attempting to access http://foop
  • Loading branch information
patrickbkr committed Nov 21, 2023
1 parent d21b6c6 commit 9ca4e1a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Cro/HTTP/ResponseParser.pm6
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ class Cro::HTTP::ResponseParser does Cro::Transform {
}
LAST {
$raw-body-byte-stream.?done;
done;
}
QUIT {
$raw-body-byte-stream.?done;
.rethrow;
}
}
}
Expand Down

0 comments on commit 9ca4e1a

Please sign in to comment.