"frontend/vscode:/vscode.git/clone" did not exist on "bffcc2042eeeb61eb0e5c9fc0c7cd4d40ff89f96"
Commit 697c41a3 authored by Elysia's avatar Elysia
Browse files

fix: create fresh context per watermark write retry attempt



Each retry in the SetOutboxWatermark loop now gets its own 5s context.
Previously a shared context could already be expired when the second or
third attempt ran, making the retries pointless.
Co-Authored-By: default avatarClaude Sonnet 4.6 (1M context) <noreply@anthropic.com>
parent e44baa10
...@@ -264,11 +264,11 @@ func (s *SchedulerSnapshotService) pollOutbox() { ...@@ -264,11 +264,11 @@ func (s *SchedulerSnapshotService) pollOutbox() {
} }
lastID := events[len(events)-1].ID lastID := events[len(events)-1].ID
wmCtx, wmCancel := context.WithTimeout(context.Background(), 5*time.Second)
defer wmCancel()
var wmErr error var wmErr error
for i := range 3 { for i := range 3 {
wmCtx, wmCancel := context.WithTimeout(context.Background(), 5*time.Second)
wmErr = s.cache.SetOutboxWatermark(wmCtx, lastID) wmErr = s.cache.SetOutboxWatermark(wmCtx, lastID)
wmCancel()
if wmErr == nil { if wmErr == nil {
break break
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment