-
Notifications
You must be signed in to change notification settings - Fork 287
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
cmd: add dial timeout and verify sink connection status #561
Conversation
Signed-off-by: Neil Shen <overvenus@gmail.com>
/run-integration-tests |
Signed-off-by: Neil Shen <overvenus@gmail.com>
/run-integration-tests |
@@ -297,6 +297,11 @@ func newMySQLSink(ctx context.Context, sinkURI *url.URL, dsn *dmysql.Config, fil | |||
if err != nil { | |||
return nil, errors.Annotatef(err, "Open database connection failed, dsn: %s", dsnStr) | |||
} | |||
err = db.PingContext(ctx) | |||
if err != nil { | |||
return nil, errors.Annotatef(err, "fail to open MySQL connection") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also add dsnStr
in the error message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could leak the password.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, yes. Seems dsnStr
in L298 also needs to be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Neil Shen <overvenus@gmail.com>
/run-integration-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Neil Shen <overvenus@gmail.com>
/run-integration-tests |
Codecov Report
@@ Coverage Diff @@
## master #561 +/- ##
================================================
- Coverage 32.2043% 32.1376% -0.0667%
================================================
Files 69 69
Lines 6909 6914 +5
================================================
- Hits 2225 2222 -3
- Misses 4524 4532 +8
Partials 160 160 |
Signed-off-by: Neil Shen <overvenus@gmail.com>
What problem does this PR solve?
Add dial timeout and verify sink connection when creating changefeed.
Cc pingcap/ticdc#542
Check List
Tests
Related changes
Release note