-
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
DM/Openapi: ignore can not connect error when force delete task #5364
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
/run-all-tests |
/cc @Ehco1996 |
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.
rest LGTM
if err == nil { | ||
return true | ||
} | ||
if force && strings.Contains(err.Error(), "connect: connection refused") { |
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.
how about use
errors.Is(err, syscall.ECONNREFUSED)
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.
i tried errors.Is(err, syscall.ECONNREFUSED)
and run inegration test, but it can't ignore connection refused
. I still don't know the root cause, i will find it out later
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.
i think this is because this error is wrapped by terror
Line 117 in e915545
return nil, terror.DBErrorAdapt(err, terror.ErrDBDriverError) |
ok not change here
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
} | ||
metaSchema := *task.MetaSchema | ||
err = s.removeMetaData(ctx, taskName, metaSchema, toDBCfg) | ||
if err != nil { | ||
return terror.Annotate(err, "while removing metadata") | ||
if !ignoreCannotConnectError(err) { |
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.
I understand forcing to delete tasks shouldn't have returned errors. But what if the user restarts the same task again but the metadata still exists?
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.
i make a discussion note here.
when user recreates the same task, and the downstream recovers again, it will still have the metadata, then it need remove metadata when start task or manually delete metadata.
after disscuss with @sunzhaoyang, this is rare, we can just print warning log. but it still has risk,and most of openapi's interface has no warning message when it can run successfully. so i will pose a #5410 to note this.
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 but probably result in #5409
Codecov Report
Flags with carried forward coverage won't be shown. Click here to find out more. @@ Coverage Diff @@
## master #5364 +/- ##
================================================
- Coverage 56.1240% 56.0341% -0.0899%
================================================
Files 522 528 +6
Lines 65325 69438 +4113
================================================
+ Hits 36663 38909 +2246
- Misses 25094 26819 +1725
- Partials 3568 3710 +142 |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: e51ecb0
|
/run-dm-integration-test |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 19fe4fa
|
/run-all-tests |
/run-dm-integration-test |
1 similar comment
/run-dm-integration-test |
/run-leak-test |
What problem does this PR solve?
Issue Number: close #5363
What is changed and how it works?
add check when delete task.
Check List
Tests
Release note