Connection leak
Closed this issue · 7 comments
In certain cases I see connection leaks. I have a simple reproduction in: https://github.com/luben/repro-hyper
The behavior I observe:
- with small requests everything works OK
- with bigger request (e.g. 1 MiB payload) there is one connection per request leaked between the worker and the broker.
- if I switch the worker/broker communication to HTTP/2 by uncommenting https://github.com/luben/repro-hyper/blob/master/src/bin/worker.rs#L16 - there is no more leaks.
Thanks, I'll try out the repro locally.
Do you have any more details that would help me while I look? Is it consistently leaking the connection immediately, or only occassionally?
It's consistently leaking with payloads of 1 MB. I have only tried and reproduced in on Linux.
I have just added a negative example with src/bin/worker-non-stream.rs - if we .concat2() the body (i.e. not stream it back) there is no leak.
Is the leak in broker, or in worker?
The connection between the worker and the broker is not closed from both sides - verified with lsof.
I see, it seems the dispatcher after having written the headers for some reason doesn't continue to do work, but stalls. I'll look more into it.
I've published v0.12.16 with a fix for this, thanks for reporting and for the reproducible instructions!