fix(loki.rules.kubernetes, mimir.rules.kubernetes): add timeout to ruler sync calls#5963
Open
QuentinBisson wants to merge 5 commits intografana:mainfrom
Open
fix(loki.rules.kubernetes, mimir.rules.kubernetes): add timeout to ruler sync calls#5963QuentinBisson wants to merge 5 commits intografana:mainfrom
QuentinBisson wants to merge 5 commits intografana:mainfrom
Conversation
…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
commented
Apr 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief description of Pull Request
Add a 30s context timeout to the
ListRules(ruler sync) calls inloki.rules.kubernetesandmimir.rules.kubernetesto prevent the event loop goroutine from blocking indefinitely on transient network issues.Previously,
syncLokiandsyncMimirpassed 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
RulerSyncTimeoutconstant is defined once in theinternal/component/common/kubernetespackage and reused by both components to avoid duplication.PR Checklist