Skip to content

Commit 29cab91

Browse files
committed
fix: panic on nil error in handoffWorkerManager closeConnFromRequest
1 parent dc053a4 commit 29cab91

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

internal/maintnotifications/logs/log_messages.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,10 @@ func RemovingConnectionFromPool(connID uint64, reason error) string {
295295
})
296296
}
297297

298-
func NoPoolProvidedCannotRemove(connID uint64, reason error) string {
299-
message := fmt.Sprintf("conn[%d] %s due to: %v", connID, NoPoolProvidedMessageCannotRemoveMessage, reason)
298+
func NoPoolProvidedCannotRemove(connID uint64) string {
299+
message := fmt.Sprintf("conn[%d] %s", connID, NoPoolProvidedMessageCannotRemoveMessage)
300300
return appendJSONIfDebug(message, map[string]interface{}{
301301
"connID": connID,
302-
"reason": reason.Error(),
303302
})
304303
}
305304

maintnotifications/handoff_worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ func (hwm *handoffWorkerManager) closeConnFromRequest(ctx context.Context, reque
506506
internal.Logger.Printf(ctx, "redis: failed to close connection: %v", err)
507507
}
508508
if internal.LogLevel.WarnOrAbove() {
509-
internal.Logger.Printf(ctx, logs.NoPoolProvidedCannotRemove(conn.GetID(), err))
509+
internal.Logger.Printf(ctx, logs.NoPoolProvidedCannotRemove(conn.GetID()))
510510
}
511511
}
512512
}

0 commit comments

Comments
 (0)