Fix to prevent consecutive reboots in case of reboot delay.#23
Conversation
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
|
Hey @hlts2 ,if we are storing the LastRebootCmdTime,i think we can remove LastTransitionTime |
|
Hi, thank you for your comments. I believe both For example, in the following case, handling it with just Condition:
K8s nodes can temporarily become What really matters is how long the node has been in the Additionally, after a reboot command is issued, the reboot might be delayed for various reasons. To prevent the same reboot command from being triggered again, it is important to track when the reboot command was last sent. This is where In summary, we use |
|
i got it,below i have listed the cases to make it more clear |
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
|
@jokestax Thank you for your review 🙇 I will merge this PR 🚀 |
Signed-off-by: hlts2 <hiroto.funakoshi.hiroto@gmail.com>
WHAT
This PR contains the following changes:
WHY
In this case, there was a scenario where the reboot was delayed for over 60 minutes. As a result, the node's LastTransitionTime remained unchanged, causing reboot commands to be issued every time. In other words, since the node's LastTransitionTime didn't change for 60 minutes, the node-agent's check loop continued to trigger, resulting in multiple reboot commands being sent during that time.
To address this, I considered it necessary to use both the node's LastTransitionTime and LastRebootCmdTime (the actual time the reboot command was sent) to handle such cases. This dual comparison ensures that reboot commands are not repeatedly triggered in the event of delays, effectively preventing unnecessary reboots.