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

[no-release-notes] tracing infra #341

Merged
merged 7 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion go/mysql/auth_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package mysql

import (
"bytes"
"context"
"crypto/rand"
"crypto/rsa"
"crypto/sha1"
Expand Down Expand Up @@ -221,7 +222,7 @@ func authServerDialogSwitchData() []byte {
func AuthServerReadPacketString(c *Conn) (string, error) {
// Read a packet, the password is the payload, as a
// zero terminated string.
data, err := c.ReadPacket()
data, err := c.ReadPacket(context.Background())
if err != nil {
return "", err
}
Expand Down
10 changes: 5 additions & 5 deletions go/mysql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func (c *Conn) Ping() error {
if err := c.writePacket([]byte{ComPing}); err != nil {
return NewSQLError(CRServerGone, SSUnknownSQLState, "%v", err)
}
data, err := c.readEphemeralPacket()
data, err := c.readEphemeralPacket(context.Background())
if err != nil {
return NewSQLError(CRServerLost, SSUnknownSQLState, "%v", err)
}
Expand Down Expand Up @@ -215,7 +215,7 @@ func parseCharacterSet(cs string) (uint8, error) {
// Returns a SQLError.
func (c *Conn) clientHandshake(params *ConnParams) error {
// Wait for the server initial handshake packet, and parse it.
data, err := c.readPacket()
data, err := c.readPacket(context.Background())
if err != nil {
return NewSQLError(CRServerLost, "", "initial packet read failed: %v", err)
}
Expand Down Expand Up @@ -336,7 +336,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error {
}

// Wait for response, should be OK.
response, err := c.readPacket()
response, err := c.readPacket(context.Background())
if err != nil {
return NewSQLError(CRServerLost, SSUnknownSQLState, "%v", err)
}
Expand All @@ -358,7 +358,7 @@ func (c *Conn) clientHandshake(params *ConnParams) error {
// handleAuthResponse parses server's response after client sends the password for authentication
// and handles next steps for AuthSwitchRequestPacket and AuthMoreDataPacket.
func (c *Conn) handleAuthResponse(params *ConnParams) error {
response, err := c.readPacket()
response, err := c.readPacket(context.Background())
if err != nil {
return NewSQLError(CRServerLost, SSUnknownSQLState, "%v", err)
}
Expand Down Expand Up @@ -759,7 +759,7 @@ func (c *Conn) requestPublicKey() (rsaKey *rsa.PublicKey, err error) {
return nil, vterrors.Errorf(vtrpcpb.Code_INTERNAL, "error sending public key request packet: %v", err)
}

response, err := c.readPacket()
response, err := c.readPacket(context.Background())
if err != nil {
return nil, NewSQLError(CRServerLost, SSUnknownSQLState, "%v", err)
}
Expand Down
Loading