Skip to content

Commit

Permalink
[improvement] proxy: add logs when connect/disconnect (#21190)
Browse files Browse the repository at this point in the history
add logs when connect/disconnect

Approved by: @zhangxu19830126, @sukki37
  • Loading branch information
volgariver6 authored Jan 14, 2025
1 parent 88803ef commit 22e1ce8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/proxy/conn_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ package proxy
import (
"math"
"sync"

"github.com/matrixorigin/matrixone/pkg/logutil"
)

// Tenant defines alias tenant name type of string.
Expand Down Expand Up @@ -198,6 +200,7 @@ func (m *connManager) connect(cn *CNServer, t *tunnel) {
m.cnTunnels[cn.uuid] = make(tunnelSet)
}
m.cnTunnels[cn.uuid][t] = struct{}{}
logutil.Infof("connect to CN server %s, the conn ID is %d", cn.uuid, cn.connID)
}

// disconnect removes a connection from connection manager.
Expand All @@ -210,6 +213,7 @@ func (m *connManager) disconnect(cn *CNServer, t *tunnel) {
}
delete(m.cnTunnels[cn.uuid], t)
delete(m.connIDServers, cn.connID)
logutil.Infof("disconnect from CN server %s, the conn ID is %d", cn.uuid, cn.connID)
}

// count returns the total connection count.
Expand Down

0 comments on commit 22e1ce8

Please sign in to comment.