mirror of
https://github.com/pgsty/minio.git
synced 2026-07-20 12:40:24 +03:00
logger: Avoid slow calls in http logger Send() function (#17747)
Send() is synchronous and can affect the latency of S3 requests when the logger buffer is full. Avoid checking if the HTTP target is online or not and increase the workers anyway since the buffer is already full. Also, avoid logs flooding when the audit target is down.
This commit is contained in:
@@ -28,7 +28,6 @@ import (
|
||||
"github.com/minio/minio/internal/mcontext"
|
||||
"github.com/minio/pkg/logger/message/audit"
|
||||
|
||||
"github.com/minio/madmin-go/v3"
|
||||
xhttp "github.com/minio/minio/internal/http"
|
||||
)
|
||||
|
||||
@@ -145,7 +144,7 @@ func AuditLog(ctx context.Context, w http.ResponseWriter, r *http.Request, reqCl
|
||||
// Send audit logs only to http targets.
|
||||
for _, t := range auditTgts {
|
||||
if err := t.Send(ctx, entry); err != nil {
|
||||
LogAlwaysIf(context.Background(), fmt.Errorf("event(%v) was not sent to Audit target (%v): %v", entry, t, err), madmin.LogKindAll)
|
||||
LogOnceIf(ctx, fmt.Errorf("Unable to send an audit event to the target `%v`: %v", t, err), "send-audit-event-failure")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user