Skip to content

Commit 0754569

Browse files
committed
classify mysql client transient error
1 parent daa6658 commit 0754569

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

flow/shared/exceptions/mysql.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ func NewMySQLStreamingError(err error) *MySQLStreamingError {
7272
return &MySQLStreamingError{err, true}
7373
}
7474

75-
var recordHeaderError tls.RecordHeaderError
76-
if errors.As(err, &recordHeaderError) {
75+
if recordHeaderError, ok := errors.AsType[tls.RecordHeaderError](err); ok {
7776
if recordHeaderError.Msg == "first record does not look like a TLS handshake" {
7877
return &MySQLStreamingError{err, true}
7978
}
@@ -83,6 +82,10 @@ func NewMySQLStreamingError(err error) *MySQLStreamingError {
8382
return &MySQLStreamingError{err, true}
8483
}
8584

85+
if strings.Contains(err.Error(), "handleAuthResult: ReadPacket: invalid sequence") {
86+
return &MySQLStreamingError{err, true}
87+
}
88+
8689
return &MySQLStreamingError{err, false}
8790
}
8891

0 commit comments

Comments
 (0)