You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
No more sending on closed channels during checkscontroller shutdown (#245)
* feat: added metrics to targetmanager
First metric announces registration state.
* test: added metrics to the tests
* fix: race condition when shutting down checks
When teh sparrow check controller would shut down, it would iterate over
the actual slice of the checks, shutdown each check and then procceed to
delete said check from the slice.
Since the shutting down procedure is instant, there was a race condition
that would delete a wrong check from the slice and then the same
shutting down loop would try and shutdown the same check again.
Just returning a copy of the slice resolves this problem, as the
iteration is now done on the copy only. A more sophisticated deletion
routine for the checks slice could be another way to handle this, but it
would probably increase the complexity of the checks and
checkscontroller structs.
* chore: shutdown message on end
* test: added validating test case
Signed-off-by: Bruno Bressi <[email protected]>
* chore: marked function as helper
* test: added test for the controller's update function
This test proves that the shallow clone works as intended and returns a clone of the slice, where the original references can still be used and updated.
* chore: bumped golangci lint to latest version
This should fix the bodyclose linting remarks
Signed-off-by: Bruno Bressi <[email protected]>
---------
Signed-off-by: Bruno Bressi <[email protected]>
0 commit comments