Skip to content

Commit 20fc3cd

Browse files
committed
fix: panic on nil error in handoffWorkerManager closeConnFromRequest
1 parent 0f746e7 commit 20fc3cd

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
@@ -464,7 +464,7 @@ func (hwm *handoffWorkerManager) closeConnFromRequest(ctx context.Context, reque
464464
if err != nil {
465465
hwm.logger().Errorf(ctx, "redis: failed to close connection: %v", err)
466466
}
467-
hwm.logger().Warnf(ctx, logs.NoPoolProvidedCannotRemove(conn.GetID(), err))
467+
hwm.logger().Warnf(ctx, logs.NoPoolProvidedCannotRemove(conn.GetID()))
468468
}
469469
}
470470

0 commit comments

Comments
 (0)