Fix variable shadowing and deferred cancel leak in rttMonitor.start()

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Unknown
    • 1.17.8, 2.4.3
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • Go Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      1. 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.
      2. 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.

            Assignee:
            Preston Vasquez
            Reporter:
            Preston Vasquez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: