Skip to content

fix(loki.rules.kubernetes, mimir.rules.kubernetes): add timeout to ruler sync calls#5963

Open
QuentinBisson wants to merge 5 commits intografana:mainfrom
QuentinBisson:fix/loki-mimir-rules-sync-timeout
Open

fix(loki.rules.kubernetes, mimir.rules.kubernetes): add timeout to ruler sync calls#5963
QuentinBisson wants to merge 5 commits intografana:mainfrom
QuentinBisson:fix/loki-mimir-rules-sync-timeout

Conversation

@QuentinBisson
Copy link
Copy Markdown
Contributor

Brief description of Pull Request

Add a 30s context timeout to the ListRules (ruler sync) calls in loki.rules.kubernetes and mimir.rules.kubernetes to prevent the event loop goroutine from blocking indefinitely on transient network issues.

Previously, syncLoki and syncMimir passed the raw component context (no deadline) to the HTTP client. If the remote ruler was unreachable silently (e.g. firewall blackhole, no TCP RST), the request would hang forever, blocking the single event-loop goroutine and preventing any further event processing or recovery.

The shared RulerSyncTimeout constant is defined once in the internal/component/common/kubernetes package and reused by both components to avoid duplication.

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

…ler sync calls

Add a 30s context timeout to the ListRules calls in syncLoki and
syncMimir to prevent the event loop goroutine from blocking indefinitely
when the remote ruler is unreachable (e.g. due to a firewall blackhole).

The shared RulerSyncTimeout constant is defined once in the common
kubernetes package and reused by both components.
@QuentinBisson QuentinBisson requested a review from a team as a code owner April 1, 2026 12:15
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.

1 participant