diff --git a/cmd/bootstrap/cmd/clusters.go b/cmd/bootstrap/cmd/clusters.go index 80ba74ad77a..441f573f429 100644 --- a/cmd/bootstrap/cmd/clusters.go +++ b/cmd/bootstrap/cmd/clusters.go @@ -38,8 +38,7 @@ func constructClusterAssignment(partnerNodes, internalNodes []model.NodeInfo) (f } // shuffle both collector lists based on a non-deterministic algorithm - var err error - partners, err = partners.Shuffle() + partners, err := partners.Shuffle() if err != nil { log.Fatal().Err(err).Msg("could not shuffle partners") } diff --git a/engine/execution/computation/query/executor.go b/engine/execution/computation/query/executor.go index 10a680475a0..7b5a7eb4b35 100644 --- a/engine/execution/computation/query/executor.go +++ b/engine/execution/computation/query/executor.go @@ -113,11 +113,11 @@ func (e *QueryExecutor) ExecuteScript( // TODO: this is a temporary measure, we could remove this in the future if e.logger.Debug().Enabled() { e.rngLock.Lock() + defer e.rngLock.Unlock() trackerID, err := rand.Uint32() if err != nil { return nil, fmt.Errorf("failed to generate trackerID: %w", err) } - e.rngLock.Unlock() trackedLogger := e.logger.With().Hex("script_hex", script).Uint32("trackerID", trackerID).Logger() trackedLogger.Debug().Msg("script is sent for execution") diff --git a/storage/badger/cleaner.go b/storage/badger/cleaner.go index b57668c825d..d9cd07997e7 100644 --- a/storage/badger/cleaner.go +++ b/storage/badger/cleaner.go @@ -89,6 +89,7 @@ func (c *Cleaner) nextWaitDuration() time.Duration { // In this specific case, `utils/rand` only errors if the system randomness fails // which is a symptom of a wider failure. Many other node components would catch such // a failure. + c.log.Warn().Msg("jitter is zero beacuse system randomness has failed") jitter = 0 } return time.Duration(c.interval.Nanoseconds() + int64(jitter))