envoyproxy / envoyproxy/nighthawk
Nighthawk doesn't correctly drain the connection pool
- Dominant language
- C++
- Stars
- 414
- Forks
- 95
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 11
Description
The pool termination code is [here](https://github.com/envoyproxy/nighthawk/blob/ed015dd6ceb77f998b34f124613c0fcd33d540e8/source/client/benchmark_client_impl.cc#L110-L131).
While the code does register an idle callback, that callback only gets called if the pool is draining. Nighthawk doesn't seem to trigger pool drain anywhere. We should call `drainConnections(DrainAndDelete)` while waiting for the pool to drain.
The current state can cause Nighthawk to crash, because the shutdown thread owns the client dispatcher and may end up reading packets while shutting down resulting in a call to pure virtual method.
This can be reproduced by running high QPS test using HTTP3/QUIC, inducing a situation where Nighthawk has to deal with some late responses after it started shutting down.
Contributor guide
Assessment
This issue has not been assessed yet.