Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression, no longer host:port reported in show processlist #30182

Closed
mjonss opened this issue Nov 26, 2021 · 3 comments · Fixed by #30183
Closed

Regression, no longer host:port reported in show processlist #30182

mjonss opened this issue Nov 26, 2021 · 3 comments · Fixed by #30183
Assignees
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@mjonss
Copy link
Contributor

mjonss commented Nov 26, 2021

Bug Report

Please answer these questions before submitting your issue. Thanks!

In #10903 the host:port was added in show processlist, but there has been a regression, resulting it it does no longer show up.

1. Minimal reproduce step (Required)

See #10903

2. What did you expect to see? (Required)

3. What did you see instead (Required)

4. What is your TiDB version? (Required)

Master branch 7a8c7f8

@mjonss mjonss added the type/bug The issue is confirmed as a bug. label Nov 26, 2021
@mjonss
Copy link
Contributor Author

mjonss commented Nov 26, 2021

Reason being cc.PeerHost() has been called before, but only returns "" for port on second call.

Fixed by something like:

diff --git a/server/conn.go b/server/conn.go
index f74c00a555..31ccba25cf 100644
--- a/server/conn.go
+++ b/server/conn.go
@@ -888,7 +888,7 @@ func (cc *clientConn) checkAuthPlugin(ctx context.Context, resp *handshakeRespon
 
 func (cc *clientConn) PeerHost(hasPassword string) (host, port string, err error) {
        if len(cc.peerHost) > 0 {
-               return cc.peerHost, "", nil
+               return cc.peerHost, cc.peerPort, nil
        }
        host = variable.DefHostname
        if cc.isUnixSocket {

@mjonss
Copy link
Contributor Author

mjonss commented Nov 26, 2021

/assign

@github-actions
Copy link

Please check whether the issue should be labeled with 'affects-x.y' or 'fixes-x.y.z', and then remove 'needs-more-info' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/major sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants