Context
- Variable shadowing causing connection leak: The outer conn variable is shadowed by conn := inside the loop. The deferred cleanup function references the outer variable, which is always nil, so connections are never closed when the monitor's context is cancelled during an active connection.
- Deferred cancel accumulation: defer cancel() inside the loop accumulates deferred calls that only execute when the function returns. Each iteration adds another deferred cancel to the stack, causing memory buildup over the RTT monitor's lifetime.
Definition of Done
- Fix issue 1 in release/1.17
- Fix issue 1 and 2 in release/2.4 and then roll in master.