fix(shared-state): restart the loop when an in-flight request ends

A request that outlived the idle window ended after the loop had
stopped. Its finish delta then stayed queued with no loop to send it.
The end function now touches the loop.
This commit is contained in:
2026-11-26 04:09:07 +00:00
parent 6438a95a76
commit 5cb01e2c4b
2 changed files with 42 additions and 1 deletions
+5 -1
View File
@@ -668,7 +668,11 @@ func (s *sharedInflight) begin(provider string) func() {
s.add(provider, epoch, "s")
var once sync.Once
return func() {
once.Do(func() { s.add(provider, epoch, "f") })
once.Do(func() {
s.add(provider, epoch, "f")
// An idle-stopped loop must restart, or this delta is never flushed.
s.loop.touch()
})
}
}