Skip to content

Conversation

@Mou887
Copy link

@Mou887 Mou887 commented Aug 25, 2025

What type of PR is this?

Add one of the following kinds:
/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

This is an automated cherry-pick of #6647 onto the release-1.12 branch.
It fixes the unreasonable informer stop behavior to ensure controllers work as expected.

Special notes for your reviewer:

This is the release note from PR #6647


`karmada-controller-manager/karmada-agent`:  Fixed the issue that informer cache sync failures for specific resources incorrectly shut down all informers for that cluster, affecting resource distribution and work status synchronization.`

@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 25, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @Mou887, 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 addresses a critical bug where informer cache synchronization failures would lead to the incorrect shutdown of all informers for a specific cluster. This behavior adversely affected the stability and functionality of controllers, disrupting resource distribution and work status synchronization. The fix involves removing the explicit calls to stop the informer managers when a cache sync error occurs, allowing informers to continue operating even if a transient sync issue arises. This ensures that controllers can maintain their expected behavior and that the system remains robust in handling temporary cache inconsistencies.

Highlights

  • Prevented premature informer shutdown: Removed calls to InformerManager.Stop or TypedInformerManager.Stop that were triggered upon cache synchronization failures.
  • Ensured controller stability: This change prevents a single cache sync failure from cascading into a complete shutdown of all informers for a given cluster, thereby maintaining the operational integrity of controllers.
  • Improved resource distribution and status synchronization: By keeping informers running despite transient sync errors, the system can continue to distribute resources and synchronize work statuses more reliably.
Using Gemini Code Assist

The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@karmada-bot karmada-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 25, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an issue where informer cache sync failures for a specific resource would incorrectly stop all informers for a given cluster. The change removes the call to InformerManager.Stop() across several controllers, ensuring that a single resource sync failure does not disrupt other controllers that depend on informers for that cluster. This improves the overall resilience and stability of the system. The changes are consistent, correct, and well-aligned with the goal of fixing the unreasonable informer stop behavior. I approve of these changes.

@zhzhuang-zju
Copy link
Contributor

Hi @Mou887 You can directly modify the original PR without submitting a new one.

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.66%. Comparing base (1336da1) to head (2da0b61).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@               Coverage Diff                @@
##           release-1.12    #6688      +/-   ##
================================================
+ Coverage         46.64%   46.66%   +0.02%     
================================================
  Files               665      665              
  Lines             54918    54913       -5     
================================================
+ Hits              25614    25627      +13     
+ Misses            27670    27655      -15     
+ Partials           1634     1631       -3     
Flag Coverage Δ
unittests 46.66% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Mou887
Copy link
Author

Mou887 commented Aug 25, 2025

Hi @zhzhuang-zju , In my earlier PR, I had made two commits instead of just one because I had to fix a linting issue (extra blank lines). I thought it might be cleaner to open a new PR, but I now realize that it would have been better to just update the original one.
For this PR, since I’ve already opened the new one, please let me know if you’d prefer me to close it and continue on the old one.

From the next cherry-picks (for 1.13 and 1.14), I will directly update the original PR as you suggested. Thank you

@zhzhuang-zju
Copy link
Contributor

Thanks
/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 25, 2025
This was referenced Aug 25, 2025
Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Thanks~
/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: XiShanYongYe-Chang, zhzhuang-zju

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 25, 2025
@karmada-bot karmada-bot merged commit 3c13542 into karmada-io:release-1.12 Aug 25, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants