-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unhealthy after failed update on startup #5412
Conversation
📝 WalkthroughWalkthroughThe changes made in this pull request involve modifications to the error handling and logging mechanisms within the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Supervisor
participant Core
User->>Core: start()
Core->>Supervisor: update()
Supervisor->>Supervisor: Check for errors
alt Error occurs
Supervisor->>Supervisor: Log critical error
Supervisor->>Supervisor: Handle OSError
else No error
Supervisor-->>Core: Update successful
end
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (2)supervisor/core.py (6)Pattern
Pattern
Pattern Pattern Pattern Pattern supervisor/supervisor.py (6)Pattern
Pattern
Pattern Pattern Pattern Pattern 🔇 Additional comments (2)supervisor/supervisor.py (1)
The change from error to critical logging level is appropriate for update failures and maintains consistency with how update failures are handled at other times. The error handling correctly creates an issue without marking the system as unhealthy. Let's verify the consistency of error handling across the codebase: supervisor/core.py (1)
The new implementation correctly:
This aligns with the PR objectives by treating update failures during startup the same as failures at any other time. Let's verify there are no other places in the codebase where update failures might still mark the system as unhealthy: Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Proposed change
One of the outcomes of the recent update issues is our handling of an update failure at startup does not make sense. Currently we react very aggressively to an update failure at this time with logging and marking the system as unhealthy. This seems like it comes from a time when users blocked Supervisor updates via firewall before we had the option to disable auto-update. As this was the one bit of code that ran before they could tweak Supervisor's container with addon hacks, we used that to inform them of the problematic situation they were in.
Now they can simply disable auto-update if they want. So an update failure at startup is really no different from a startup failure at any point in time. And since all other updates are blocked while Supervisor is out of date I wouldn't really consider Supervisor unhealthy. There's an issue which we create any time a Supervisor update fails but its not unhealthy:
supervisor/supervisor/supervisor.py
Lines 202 to 209 in 9f414ee
I also removed the aggressive logging and exception capture at this point in the code because its redundant. As you can see we already capture the real exception and there's already logging about this. I bumped the level to
critical
to match the existing level.Type of change
Additional information
Checklist
ruff format supervisor tests
)If API endpoints or add-on configuration are added/changed:
Summary by CodeRabbit
New Features
Bug Fixes
update_apparmor
method.Refactor