Skip to content

Add informer sync timeout#76

Open
piceri wants to merge 5 commits intomainfrom
piceri/informer-sync-timeout
Open

Add informer sync timeout#76
piceri wants to merge 5 commits intomainfrom
piceri/informer-sync-timeout

Conversation

@piceri
Copy link
Copy Markdown
Contributor

@piceri piceri commented Apr 9, 2026

This changes adds a timeout to the informer sync process in the controller. Without this timeout, the controller can become stuck waiting for informers to sync.

For example, informers cannot sync if deployment tracker does not have the proper Kubernetes permissions but a lack of permissions does not trigger any fatal errors. This would result in the controller being stuck waiting for the sync to complete.

piceri added 3 commits April 9, 2026 13:46
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
@piceri piceri marked this pull request as ready for review April 9, 2026 20:52
@piceri piceri requested a review from a team as a code owner April 9, 2026 20:52
Copilot AI review requested due to automatic review settings April 9, 2026 20:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a bounded timeout to the controller’s informer cache sync phase so the controller can fail fast instead of hanging indefinitely when informers can’t sync (e.g., due to missing RBAC permissions).

Changes:

  • Introduces a default informer sync timeout (60s) and wires it into Controller.Run() via a timeout-derived context.
  • Improves the cache-sync failure error message to hint at likely RBAC causes.
  • Adds a unit test intended to verify Run() returns when informer cache sync is blocked.
Show a summary per file
File Description
internal/controller/controller.go Adds a controller-level informer sync timeout and uses it to bound WaitForCacheSync.
internal/controller/controller_test.go Adds a test that simulates blocked informer listing to ensure sync timeout triggers.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 3

piceri added 2 commits April 9, 2026 17:41
Signed-off-by: Eric Pickard <piceri@github.com>
Signed-off-by: Eric Pickard <piceri@github.com>
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.

2 participants