Skip to content

Commit d69a263

Browse files
router: avoid deadlock in rebalance (#817) (#818)
Co-authored-by: djshow832 <[email protected]>
1 parent cf697c3 commit d69a263

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

pkg/balance/router/router_score.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,6 @@ func (router *ScoreBasedRouter) redirectConn(conn *connWrapper, fromBackend *bac
393393
zap.String("to", toBackend.addr),
394394
}
395395
fields = append(fields, logFields...)
396-
fields = append(fields, conn.ConnInfo()...)
397396
succeed := conn.Redirect(toBackend)
398397
if succeed {
399398
router.logger.Debug("begin redirect connection", fields...)

pkg/proxy/backend/backend_conn_mgr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,7 @@ func (mgr *BackendConnManager) UpdateLogger(fields ...zap.Field) {
838838
}
839839

840840
// ConnInfo returns detailed info of the connection, which should not be logged too many times.
841+
// Be careful about deadlocks.
841842
func (mgr *BackendConnManager) ConnInfo() []zap.Field {
842843
mgr.processLock.Lock()
843844
var fields []zap.Field

0 commit comments

Comments
 (0)