-
Task
-
Resolution: Done
-
Blocker
-
1.24.0
-
None
WHAT
The installation_controller_reconcile_delayed metric measures whether the rhmi_controller reconcile function is taking more than 12 minutes to complete by using a golang timer. In the beginning of the reconcile we start the timer and we call time.AfterFunc(time.Minute*12, func() {}) without cancelling the timer when the reconcile completes. The timer is not cancelled on exit of the reconcile function which could trigger a false positive in some scenarios for the alert RHOAMInstallationControllerReconcileDelayed.
HOW
The second parameter (func) of the AfterFunc runs in its own goroutine and has to be killed before we exit the reconcile function. This can be done by using a defer call to https://pkg.go.dev/time#Timer.Stop after the timer has been setup.
TESTS
<List of related tests>
DONE
timer is cancelled anytime the reconcile function exits, no matter its result.