Skip to content

Conversation

squeed
Copy link
Contributor

@squeed squeed commented May 28, 2025

As I was working on some other shutdown code, I noticed that the agent no longer gracefully shuts down. This was due to a few hung shutdown processes.

Please review by commit. The fixes were minor.

@squeed squeed requested review from a team as code owners May 28, 2025 09:01
@squeed squeed added kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact. labels May 28, 2025
@squeed squeed requested review from thorn3r, tklauser and ldelossa May 28, 2025 09:01
@squeed
Copy link
Contributor Author

squeed commented May 28, 2025

/test

squeed added 4 commits May 28, 2025 15:17
When the healthz job has its context closed, we should be closing the
server. Otherwise, the healthz server lingers as the agent is trying to
close.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
When shutting down the agent, sometimes the number of nodes is zero.
This causes a divide-by-zero panic.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
The iptables reconciler was waiting for the manager to close all
channes, but Hive won't shut down the manager until the reconciler has
stopped.

So, reorder how they're added to the lifecycle.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
As the agent shut down, this controller was stuck, retrying over and
over, as regeneration was failing. We can detect this case and return a
special error to indicate the controller is done.

Signed-off-by: Casey Callendrello <cdc@isovalent.com>
Copy link
Member

@sayboras sayboras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing agent health.

@squeed
Copy link
Contributor Author

squeed commented May 28, 2025

/test

@squeed squeed added this pull request to the merge queue May 29, 2025
Merged via the queue into cilium:main with commit e87e9e2 May 29, 2025
67 checks passed
@squeed squeed deleted the shutdown-fixes branch May 29, 2025 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup This includes no functional changes. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants