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
I found a race condition in the reboot required metric.
It was caused by:
the manager not sending "reboot required" over the broker upon startup
(I think. I am not sure comin watch does report the reboot required correctly, but I verified /both/ changes were necessary so I believe this is the case)
the metrics subscribing to the broker too late, missing the "reboot required" event
I am not sure comin watch does report the reboot required correctly
Currently, when a client connect to the stream, the server first start by sending the manager state. This is used by the comin watch command to initialize its state. So, when a reboot is required from previous runs, the client doesn't get to be notifed.
I would prefer to only send notifications when the event actually occurs (i already think about renaming the event ManagerState to something such as Started).
Let me try to propose another approach.
I think the issue is that the manager is initialized in the manager.Run function.
What do you think about moving the manager.NeedToReboot initialization from the manager.Run function to the manager.New function?
In this case, the command run could manually set the prometheus need_to_reboot metric, before running the manager.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found a race condition in the reboot required metric.
It was caused by:
comin watchdoes report the reboot required correctly, but I verified /both/ changes were necessary so I believe this is the case)