-
Notifications
You must be signed in to change notification settings - Fork 672
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
[BUG] Flyte DBX (GO) plugin does not handle HTTP 429 response #5203
Comments
Hey there @rambrus! Good to see you back. 😊 I remember our last cosmic dance with the code. I'm diving into this issue now and will circle back with some insights soon! |
Thank you for bringing this to our attention. It seems like you're encountering two issues: one related to the handling of HTTP 429 responses and another related to an HTTP 401 Unauthorized error. For the first issue, the Flyte Databricks (DBX) plugin currently attempts to parse the response body for all HTTP status codes, which is causing the "unexpected end of JSON input" error when a non-JSON response is returned for HTTP 429 responses. To address this, the plugin could be updated to handle HTTP 429 responses by skipping the task status update instead of attempting to parse the non-JSON response. This could be done by modifying the if resp.StatusCode == http.StatusTooManyRequests {
// Log the rate limit issue, skip the update, or implement retry logic
return nil, nil // or a specific error indicating to skip the update
} For the second issue, the plugin currently does not handle HTTP 401 Unauthorized responses differently from other types of errors. When the Regarding the CORS-related headers mentioned in the log output, this could be a separate issue related to the configuration of the Databricks API or the network environment in which your application is running. It would be helpful to have more information about the specific CORS error message and the network configuration to provide a more accurate diagnosis. I hope this helps address your concerns. If you have any further questions or need more clarification, please don't hesitate to ask. Sources
|
As I understand it, this block will never be reached, since responses other than HTTP 200 do not have a JSON body and json.Unmarshal(responseBody, &data) will fail with an unexpected end of JSON input error. |
Reviewed the code, tried to understand the plugin design, my interpretation:
This means that Is that a correct assumption? |
Yes I think is. |
Describe the bug
We are using Flyte with Databricks plugin (GO) with the following config:
Databricks API uses a very low API rate limit for job polling (100), Flyte tasks often run into HTTP 429 - Too Many Requests response.
We have done some code analysis and found out that HTTP 429 is not handled properly in DBX plugin.
The plugin expects Databricks to return a JSON response in all cases, no matter what the response code is.
Actually, Databricks API only returns JSON response in case of HTTP 200, in other cases (e.g. HTTP 429) a non-json response is returned. DBX plugin tries to parse the response in every cases, but fails with unexpected end of JSON input (see attached screenshot).
Expected behavior
Flyte DBX plugin handles HTTP 429 reponse properly (skip status task status update)
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: