Uploaded image for project: 'Red Hat Advanced Cluster Security'
  1. Red Hat Advanced Cluster Security
  2. ROX-33378

time.NewTicker created inside a loop without Stop()

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • Fleet Management
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • False

      File: fleetshard/pkg/central/cloudprovider/awsclient/rds.go#L392-L400

      waitForInstanceToBeAvailable polls AWS RDS in a for loop. On every iteration it calls time.NewTicker(...) but never calls ticker.Stop(). Each ticker allocates an internal goroutine and channel that cannot be GC'd until the ticker fires. During a normal RDS provisioning wait of ~10 minutes (with awsRetrySeconds = 30), roughly 20 leaked ticker goroutines accumulate before the earliest ones fire and are cleaned up.

      Network amplification: If network issues slow the AWS API without causing errors (e.g. internal SDK retries), the loop runs longer and more tickers accumulate. Outright errors exit the function cleanly.

      Fix: Move the ticker outside the loop with defer ticker.Stop(), or replace with time.After for one-shot delays.

              Unassigned Unassigned
              rh-ee-mhess Michael Hess
              ACS Cloud Service
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: