h1 servers can shutdown connections with pending buffered data on filled sockets#4018
Conversation
3de4ad6 to
e786002
Compare
|
After some discussion, decided to not follow the approach of returning pending from within the poll loop as it could cause us to read less frequently ... given that the bug is explicitly that we shouldn't call shutdown whenever buffered hasn't completed then it probably makes sense to ensure that |
e786002 to
0757da0
Compare
|
|
|
Sorry for the delay, just took a look. So, I think ultimately, the In the meantime, this patch does fix it, so I'm inclined to go with it. It looks like CI is angry about an unused method, now. |
cc08d5a to
3c039ea
Compare
Thanks for taking a look @seanmonstar . Yes it was the fragility of alternative changes that caused the shutdown instead ... otherwise the best option would be to the poll_loop itself. Willing to look into it in a separate PR if need be |
|
Hm, is the CI failure relevant? Kinda looks that way, but I'm distracted at the moment: Test output``` Running tests/ready_on_poll_stream.rs (target/debug/deps/ready_on_poll_stream-d4f86d9d0defa2fd)running 1 test failures: ---- body_test stdout ---- thread 'body_test' (3627) panicked at tests/h1_server/fixture.rs:105:17: as core::future::future::Future>::poll failures: test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.73s |
764686d to
faa15de
Compare
faa15de to
f41c288
Compare
Yes |
seanmonstar
left a comment
There was a problem hiding this comment.
Right on, thanks for the fix!
Target fix for #4022
The fix I am proposing is to simply propagate pending flushes within the poll loop to give the buffer a chance to get fully flushed and the included test just simply asserts that
shutdownwas not called with pending flushesI did notice a previously yanked change on here that modified the poll loop to achieve something similar but this should lead to exiting the poll loop and waiting to get polled again rather than exhausting the CPU