-
Notifications
You must be signed in to change notification settings - Fork 154
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
fix(dli): catch and handle the 408 errors #4706
fix(dli): catch and handle the 408 errors #4706
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This PR has been approved by: @Lance52259 |
return diag.Errorf("error creating DLI database (%s): %s", dbName, err) | ||
} | ||
} else if resp != nil && !resp.IsSuccess { | ||
return diag.Errorf("the request was sent successfully, but some errors occurred: %s", resp.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.
if resp == nil {
return diag.Errorf("error creating DLI database (%s): The creation API response is empty.", dbName)
}
if !resp.IsSuccess {
return diag.Errorf("the request was sent successfully, but some errors occurred: %s", resp.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.
we don't care about the case of the response is nil, because we don't need to parse it.
if err != nil { | ||
return diag.Errorf("error create DLI datatable (%s) to the database (%s): %s", databaseName, tableName, err) | ||
} | ||
} else if resp != nil && !resp.IsSuccess { |
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.
ditto
if _, ok := queryErr.(golangsdk.ErrDefault404); !ok { | ||
return detail, "ERROR", queryErr | ||
} | ||
return detail, "COMPLETED", nil |
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.
Variable detail
may be nil.
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.
the result of Get() method during golangsdk will have the type value (corresponding structure) in any times, will not be nil (nil means the type and value are both empty)
Please add descriptions of |
06e5b1c
to
a8190a9
Compare
/lgtm |
What this PR does / why we need it:
When resource (database or data table) create or delete by provider, due to the shared queue is their bottom layer relies resource, timeout errors (status code: 408, error code: DLI.0019) will be frequently returned when the usage is large.
If you try again immediately, the following error will be thrown:
Which issue this PR fixes:
(optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged)fixes #xxx
Special notes for your reviewer:
Release note:
PR Checklist
Acceptance Steps Performed