From b886fed2fb01874d7648ee72b0124d0b4af41529 Mon Sep 17 00:00:00 2001 From: Waldemar Quevedo Date: Thu, 4 May 2023 15:50:45 -0700 Subject: [PATCH] Stop using UTC for time for flushClients In #1943 it was adopted to use `UTC()` in some timestamps, but an unintended side effect from this is that it strips the monotonic time, so it can be prone to clock skews when subtracting time in other areas of the code. https://github.com/golang/go/commit/e5646b23dee5eb6f896a3eef45959aa130857988 --- server/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/client.go b/server/client.go index 662dc7df..6fd3585c 100644 --- a/server/client.go +++ b/server/client.go @@ -1144,7 +1144,7 @@ func (c *client) writeLoop() { // sent to during processing. We pass in a budget as a time.Duration // for how much time to spend in place flushing for this client. func (c *client) flushClients(budget time.Duration) time.Time { - last := time.Now().UTC() + last := time.Now() // Check pending clients for flush. for cp := range c.pcd {