mirror of
https://github.com/minio/minio.git
synced 2025-01-11 15:03:22 -05:00
do not log client canceled events (#17838)
This commit is contained in:
parent
dde1a12819
commit
11dfc817f3
@ -377,7 +377,11 @@ func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
||||
select {
|
||||
case h.logCh <- entry:
|
||||
case <-ctx.Done():
|
||||
return ctx.Err()
|
||||
// return error only for context timedout.
|
||||
if errors.Is(ctx.Err(), context.DeadlineExceeded) {
|
||||
return ctx.Err()
|
||||
}
|
||||
return nil
|
||||
default:
|
||||
nWorkers := atomic.LoadInt64(&h.workers)
|
||||
if nWorkers < maxWorkers {
|
||||
|
@ -330,6 +330,12 @@ func (h *Target) Send(ctx context.Context, entry interface{}) error {
|
||||
|
||||
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
|
||||
default:
|
||||
// log channel is full, do not wait and return
|
||||
// an error immediately to the caller
|
||||
|
Loading…
Reference in New Issue
Block a user