Skip to content
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

fix: apiserver watcher refresh shouldn't crash plugin manager #576

Merged
merged 33 commits into from
Aug 20, 2024

Conversation

jimassa
Copy link
Contributor

@jimassa jimassa commented Jul 31, 2024

Description

This PR modifies the APIServer watcher to improve error handling and optimize performance:

  1. Error Handling: Instead of returning a resolution error to the caller, watcher now retries the host lookup, after 3 refresh, if we still can't resolve the apiserver IP, we bail and return the error to the watcher manager.
  2. Optimization: Moved the hostname retrieval to the initialization function. This change ensures that the hostname is obtained once during initialization and not on every refresh, as the hostname does not change.

Related Issue

#565

If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.

Checklist

  • I have read the contributing documentation.
  • I signed and signed-off the commits (git commit -S -s ...). See this documentation on signing commits.
  • I have correctly attributed the author(s) of the code.
  • I have tested the changes locally.
  • I have followed the project's style guidelines.
  • I have updated the documentation, if necessary.
  • I have added tests, if applicable.

Screenshots (if applicable) or Testing Completed

Please add any relevant screenshots or GIFs to showcase the changes made.

Additional Notes

Add any additional notes or context about the pull request here.


Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.

@jimassa jimassa requested a review from a team as a code owner July 31, 2024 16:31
@jimassa jimassa linked an issue Jul 31, 2024 that may be closed by this pull request
@jimassa jimassa changed the title fix: Watcher Refresh shouldn't crash plugin manager fix: watcher refresh shouldn't crash plugin manager Jul 31, 2024
@jimassa jimassa changed the title fix: watcher refresh shouldn't crash plugin manager fix: apiserver watcher refresh shouldn't crash plugin manager Aug 12, 2024
pkg/watchers/apiserver/apiserver.go Outdated Show resolved Hide resolved
pkg/watchers/apiserver/apiserver.go Outdated Show resolved Hide resolved
pkg/watchers/apiserver/apiserver.go Outdated Show resolved Hide resolved
pkg/watchers/apiserver/apiserver.go Outdated Show resolved Hide resolved
@jimassa jimassa added this pull request to the merge queue Aug 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 20, 2024
@jimassa jimassa added this pull request to the merge queue Aug 20, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 20, 2024
@jimassa jimassa added this pull request to the merge queue Aug 20, 2024
Merged via the queue into main with commit 5f345f3 Aug 20, 2024
22 checks passed
@jimassa jimassa deleted the jmassa/api_watcher_fix branch August 20, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Watcher Refresh failure crashes Retina agent
3 participants