-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Per #4043, there was a bug in draining connections using the TCP connection pool in conjunction with the TCP proxy.
Repro steps:
It's pretty easily reproduced by adding a TCP proxy test case that configures a drain callback and then simulates an upstream close.
The connection pool invokes the TCP proxy's callback, which releases the connection back to the pool, placing it in the ready list (the connection pool has not yet processed the close event). Upon processing the event, the conn pool attempts to remove the connection from the busy list (where it no longer resides) and then triggers the drain callback which loops over the ready list, closing connections. Because the connection is already closed, no event is triggered and the connection remains on the ready list, causing an infinite loop.
Call Stack: see #4043