Skip to content

Commit

Permalink
use fatal logging when system randomness fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarak Ben Youssef committed Jul 12, 2023
1 parent 1f1a341 commit 183ce49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/mempool/herocache/backdata/heropool/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (p *Pool) sliceIndexForEntity() (i EIndex, hasAvailableSlot bool, ejectedEn
// we only eject randomly when the pool is full and random ejection is on.
random, err := rand.Uint32n(p.size)
if err != nil {
p.logger.Warn().Err(err).
p.logger.Fatal().Err(err).
Msg("hero pool random ejection failed - falling back to LRU ejection")
// fall back to LRU ejection only for this instance
return lruEject()
Expand Down

0 comments on commit 183ce49

Please sign in to comment.