mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
avoid too much auditing during decom/rebalance make it more robust (#19174)
there can be a sudden spike in tiny allocations, due to too much auditing being done, also don't hang on the ``` h.logCh <- entry ``` after initializing workers if you do not have a way to dequeue for some reason.
This commit is contained in:
@@ -416,7 +416,14 @@ func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
||||
go h.startHTTPLogger(ctx)
|
||||
}
|
||||
}
|
||||
h.logCh <- entry
|
||||
select {
|
||||
case h.logCh <- entry:
|
||||
case <-ctx.Done():
|
||||
// return error only for context timedout.
|
||||
if errors.Is(ctx.Err(), context.DeadlineExceeded) {
|
||||
return ctx.Err()
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
atomic.AddInt64(&h.totalMessages, 1)
|
||||
|
||||
Reference in New Issue
Block a user