Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v17] Reduce log spam generated by conflicting session_id and event_index #48605

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions lib/events/dynamoevents/dynamoevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,12 +575,18 @@ func (l *Log) putAuditEvent(ctx context.Context, sessionID string, in apievents.
// item event index/session id. Since we can't change the session
// id, update the event index with a new value and retry the put
// item.
l.logger.ErrorContext(ctx, "Conflict on event session_id and event_index",
"error", err,
"event_type", in.GetType(),
"session_id", sessionID,
"event_index", in.GetIndex())
return trace.Wrap(l.handleConditionError(ctx, err, sessionID, in))
if err2 := l.handleConditionError(ctx, err, sessionID, in); err2 != nil {
// Only log about the original conflict if updating
// the session information fails.
l.logger.ErrorContext(ctx, "Conflict on event session_id and event_index",
"error", err,
"event_type", in.GetType(),
"session_id", sessionID,
"event_index", in.GetIndex())
return trace.Wrap(err2)
}

return nil
}

return err
Expand Down
Loading