Skip to content

Commit 7fd1e9d

Browse files
committed
fix: panic on nil error in handoffWorkerManager closeConnFromRequest
1 parent 942bf0e commit 7fd1e9d

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

0 commit comments

Comments
 (0)