fix: systemd ordering cycle in nvfd-fan-control.service + add retry strategy #12
Conversation
Remove After= and Wants= directives to avoid ordering cycles caused by nvfd.service's After=multi-user.target. Place StartLimitBurst/StartLimitIntervalSec in [Unit] section to rate limit restarts: max 3 restarts in 400 seconds, with 90s between attempts. Changes: - Removed After=nvfd.service, Wants=nvfd.service (causes cycles) - Added StartLimitBurst=3, StartLimitIntervalSec=400 in [Unit] section - RestartSec=90 (to fit within rate limit window) - Script waits up to 30s for nvfd.service with 1s polling This ensures: - No systemd dependency cycles on start or stop - Graceful waiting for nvfd without aggressive restart storms - Rate-limited retries if nvfd fails to start
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the stability and reliability of the NVIDIA fan control service by addressing a critical systemd dependency cycle. It reconfigures the service's startup behavior to prevent deadlocks and introduces a more resilient retry mechanism. Furthermore, the fan control script now proactively waits for its essential nvfd.service dependency to be fully operational, ensuring proper initialization and reducing startup failures. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The changes effectively address the systemd ordering cycle by removing direct service dependencies and implementing a robust retry mechanism. The nvfd-fan-control.sh script now explicitly waits for the nvfd.service to be ready, preventing issues if nvfd starts slowly. The systemd unit file is updated to use on-failure restarts with a longer delay and rate limiting, which improves the service's resilience.
Add error log if `nvfd.service` is not ready after 30s Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
LGTM! Thanks for the fix. |
Fix dependency cycle error on
nvfd-fan-service.Here is the error :
Add a systemd retry strategy within a 400s window, and scripts now waits up to 30s if
nvfdservice is not started.Here is an example of a fan control service with no
nvfdservice :