Skip to content

Commit

Permalink
Replace sharded jitters with thread-local ones
Browse files Browse the repository at this point in the history
  • Loading branch information
espadolini committed Nov 12, 2024
1 parent afdb59c commit 1564a86
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 38 deletions.
2 changes: 1 addition & 1 deletion e
Submodule e updated from 735e27 to 7c39e2
9 changes: 5 additions & 4 deletions lib/inventory/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"github.com/gravitational/teleport/api/constants"
apidefaults "github.com/gravitational/teleport/api/defaults"
"github.com/gravitational/teleport/api/types"
"github.com/gravitational/teleport/api/utils/retryutils"
usagereporter "github.com/gravitational/teleport/lib/usagereporter/teleport"
"github.com/gravitational/teleport/lib/utils"
"github.com/gravitational/teleport/lib/utils/interval"
Expand Down Expand Up @@ -294,8 +295,8 @@ func (c *Controller) RegisterControlStream(stream client.UpstreamInventoryContro
interval.SubInterval[intervalKey]{
Key: instanceHeartbeatKey,
VariableDuration: c.instanceHBVariableDuration,
FirstDuration: fullJitter(c.instanceHBVariableDuration.Duration()),
Jitter: seventhJitter,
FirstDuration: retryutils.FullJitter(c.instanceHBVariableDuration.Duration()),
Jitter: retryutils.SeventhJitter,
})
handle := newUpstreamHandle(stream, hello, ticker)
c.store.Insert(handle)
Expand Down Expand Up @@ -430,8 +431,8 @@ func (c *Controller) handleControlStream(handle *upstreamHandle) {
handle.ticker.Push(interval.SubInterval[intervalKey]{
Key: serverKeepAliveKey,
Duration: c.serverKeepAlive,
FirstDuration: halfJitter(c.serverKeepAlive),
Jitter: seventhJitter,
FirstDuration: retryutils.HalfJitter(c.serverKeepAlive),
Jitter: retryutils.SeventhJitter,
})
keepAliveNeedInit = false
}
Expand Down
33 changes: 0 additions & 33 deletions lib/inventory/helpers.go

This file was deleted.

0 comments on commit 1564a86

Please sign in to comment.