bandit icon indicating copy to clipboard operation
bandit copied to clipboard

Make HTTP/1.1 implementation respect read_timeout configuration

Open mtrudel opened this issue 2 years ago • 3 comments

The HTTP/1.1 stack doesn't currently respect the top-level read_timeout parameter. This comes down mostly to passing it into Socket.recv calls and returning it on keepalive loops. For testing prior art, see https://github.com/mtrudel/bandit/blob/main/test/bandit/http2/protocol_test.exs#L62

mtrudel avatar Oct 12 '21 23:10 mtrudel

Hi, would this be a good first issue to tackle (if no one else is already)?

afsharalex avatar Apr 25 '22 04:04 afsharalex

Hi! Thanks for the offer of help!

I've been thinking that this timeout work (as well as the existing HTTP2 timeout work referenced above) belong better as a configurable parameter in the underlying socket as implemented in Thousand Island. Having to carry a timeout value around in Bandit's state seems the wrong pace to do it when the ThousandIsland.Socket island struct is already carrying the underlying socket around (and is, by necessity, the API through which ALL requests to the underlying socket pass so it's a natural place to apply such a timeout).

If you're game for taking that work on it would be much appreciated. I've written up my initial thoughts on the matter at https://github.com/mtrudel/thousand_island/issues/15

Once that work lands, the scope of this ticket can change to actually remove timeout code from the HTTP/2 side, since we'll be able to handle both cases intrinsically using the new Thousand Island timeout feature.

WDYT?

mtrudel avatar Apr 25 '22 14:04 mtrudel

Awesome, sounds good!

I'd love to help out with Thousand Island as well :)

Thanks!

afsharalex avatar Apr 25 '22 14:04 afsharalex

This landed back in 46622b7be872f3f9ebb8ccc522bbcd6e1f2f990b and I neglected to close this issue

mtrudel avatar Sep 20 '22 01:09 mtrudel