refactor(corrosion): reduce transport retry time for corrosion 10s->2s, move some logs to error level

This commit is contained in:
Pasha Sviderski
2026-06-24 16:06:00 +10:00
parent a040ce5f8e
commit 9ea30e6ee9
3 changed files with 13 additions and 13 deletions
+2 -2
View File
@@ -297,13 +297,13 @@ func (c *APIClient) resubscribeWithBackoffFn(id string) func(context.Context, ui
// A gone subscription can never be resubscribed, so stop retrying immediately and let the caller
// recover by creating a fresh subscription.
if errors.Is(err, ErrSubscriptionNotFound) {
slog.Debug("Corrosion subscription no longer exists, giving up resubscribing.",
slog.Error("Corrosion subscription no longer exists, giving up resubscribing.",
"id", id, "from_change", fromChange)
return nil, backoff.Permanent(fmt.Errorf("resubscribe to %s: %w", id, err))
}
// Don't log retries triggered by context cancellation, the backoff will stop immediately.
if ctx.Err() == nil {
slog.Debug("Failed to resubscribe to Corrosion query. Retrying with backoff.",
slog.Error("Failed to resubscribe to Corrosion query. Retrying with backoff.",
"id", id, "from_change", fromChange, "err", err)
}
}