Skip to content

Commit

Permalink
prevent crash during timer expiration after stream is closed (argopro…
Browse files Browse the repository at this point in the history
…j#19917)

Reorder ticker stop and close merge to prevent send(true) happens after merge is closed, in rare situation when the timer expires exactly at the point between close(merge) and ticker.Stop()

Signed-off-by: morapet <[email protected]>
  • Loading branch information
morapet authored and agaudreault committed Oct 7, 2024
1 parent ee4f09e commit d667851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/application/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func mergeLogStreams(streams []chan logEntry, bufferingDuration time.Duration) c

_ = send(true)

close(merged)
ticker.Stop()
close(merged)
}()
return merged
}

0 comments on commit d667851

Please sign in to comment.