Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 18 additions & 8 deletions internal/maintnotifications/logs/log_messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,19 +288,29 @@ func OperationNotTracked(connID uint64, seqID int64) string {

// Connection pool functions
func RemovingConnectionFromPool(connID uint64, reason error) string {
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, RemovingConnectionFromPoolMessage, reason)
return appendJSONIfDebug(message, map[string]interface{}{
metadata := map[string]interface{}{
"connID": connID,
"reason": reason.Error(),
})
"reason": "unknown", // this will be overwritten if reason is not nil
}
if reason != nil {
metadata["reason"] = reason.Error()
}

message := fmt.Sprintf("conn[%d] %s due to: %v", connID, RemovingConnectionFromPoolMessage, reason)
return appendJSONIfDebug(message, metadata)
}

func NoPoolProvidedCannotRemove(connID uint64, reason error) string {
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, NoPoolProvidedMessageCannotRemoveMessage, reason)
return appendJSONIfDebug(message, map[string]interface{}{
metadata := map[string]interface{}{
"connID": connID,
"reason": reason.Error(),
})
"reason": "unknown", // this will be overwritten if reason is not nil
}
if reason != nil {
metadata["reason"] = reason.Error()
}

message := fmt.Sprintf("conn[%d] %s due to: %v", connID, NoPoolProvidedMessageCannotRemoveMessage, reason)
return appendJSONIfDebug(message, metadata)
}

// Circuit breaker functions
Expand Down
6 changes: 3 additions & 3 deletions maintnotifications/handoff_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ func (hwm *handoffWorkerManager) closeConnFromRequest(ctx context.Context, reque
internal.Logger.Printf(ctx, logs.RemovingConnectionFromPool(conn.GetID(), err))
}
} else {
err := conn.Close() // Close the connection if no pool provided
if err != nil {
internal.Logger.Printf(ctx, "redis: failed to close connection: %v", err)
errClose := conn.Close() // Close the connection if no pool provided
if errClose != nil {
internal.Logger.Printf(ctx, "redis: failed to close connection: %v", errClose)
}
if internal.LogLevel.WarnOrAbove() {
internal.Logger.Printf(ctx, logs.NoPoolProvidedCannotRemove(conn.GetID(), err))
Expand Down
Loading