Skip to content

Commit 1722fd2

Browse files
authored
Merge pull request #2295 from authzed/fix-revision-heartbeat-lock-interval
fix leader election retry interval for revision heartbeat
2 parents 117b6d3 + 412f092 commit 1722fd2

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

internal/datastore/postgres/postgres.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ func (pgd *pgDatastore) startRevisionHeartbeat(ctx context.Context) error {
751751
}
752752

753753
jitter := time.Duration(float64(heartbeatDuration) * rand.Float64() * defaultMaxHeartbeatLeaderJitterPercent / 100) // nolint:gosec
754-
time.Sleep(jitter)
754+
time.Sleep(heartbeatDuration + jitter)
755755
}
756756

757757
defer func() {

internal/graph/lookupresources2.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ func (crr *CursoredLookupResources2) afterSameType(
115115
req ValidatedLookupResources2Request,
116116
parentStream dispatch.LookupResources2Stream,
117117
) error {
118-
ctx, span := tracer.Start(ctx, "lookupViaReachability")
118+
reachabilityForString := req.ResourceRelation.Namespace + "#" + req.ResourceRelation.Relation
119+
ctx, span := tracer.Start(ctx, "reachability: "+reachabilityForString)
119120
defer span.End()
120121

121122
dispatched := NewSyncONRSet()
@@ -145,9 +146,7 @@ func (crr *CursoredLookupResources2) afterSameType(
145146
spiceerrors.DebugAssert(func() bool {
146147
return err == nil
147148
}, "Error in entrypoint.DebugString()")
148-
ctx, span := tracer.Start(ctx, "entrypoint", trace.WithAttributes(
149-
attribute.String("entrypoint", ds),
150-
))
149+
ctx, span := tracer.Start(ctx, "entrypoint: "+ds, trace.WithAttributes())
151150
defer span.End()
152151

153152
switch entrypoint.EntrypointKind() {

0 commit comments

Comments
 (0)