Skip to content
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

Add support for user defined _retryable_error in databricks provider #43127

Open
2 tasks done
rawwar opened this issue Oct 17, 2024 · 5 comments
Open
2 tasks done

Add support for user defined _retryable_error in databricks provider #43127

rawwar opened this issue Oct 17, 2024 · 5 comments

Comments

@rawwar
Copy link
Collaborator

rawwar commented Oct 17, 2024

Description

we can let users pass their own _retryable_error method, which will validate if retry is allowed or not.

As of now, databricks operators only accept retry_limit and retry_delay. Adding support for custom retry function and after func should be good enough to handle all custom requirements.

"retry": retry_if_exception(self._retryable_error),

Use case/motivation

It will allow user to set their own retry logics and also not require change to the provider everytime a user wants to retry for a particular type of exception.

Related issues

#43080

Are you willing to submit a PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@rawwar rawwar added kind:feature Feature Requests needs-triage label for new issues that we didn't triage yet labels Oct 17, 2024
@rawwar rawwar changed the title Add support user defined _retryable_error in databricks provider Add support user defined _retryable_error in databricks provider Oct 17, 2024
@rawwar
Copy link
Collaborator Author

rawwar commented Oct 17, 2024

@potiuk , @pankajkoti , requesting your comments on this feature.

@rawwar rawwar changed the title Add support user defined _retryable_error in databricks provider Add support for user defined _retryable_error in databricks provider Oct 18, 2024
@pankajkoti
Copy link
Member

pankajkoti commented Oct 18, 2024

yeah, IMO another option is that we could accept a user supplied list of retryable errors & add those to our _retryable_error validation method. Probably we could also wait to work on this until there is a good demand for this? And users say how they would like it to be exposed as (how much control they would like)?

@rawwar rawwar self-assigned this Oct 18, 2024
@rawwar
Copy link
Collaborator Author

rawwar commented Oct 18, 2024

yeah, IMO another option is that we could accept a user supplied list of retryable errors & add those to our _retryable_error validation method. Probably we could also wait to work on this until there is a good demand for this? And users say how they would like it to be exposed as (how much control they would like)?

I won't start working on this right away. But, if I see any users requesting this, I'll raise a PR

@lucafurrer
Copy link

IMO I think it will be a simpler interface if we pass a list of errors to add instead of a function. In particular since rewriting your own function more or less implies to go check the current implementation to make that you have not forgot any special use case.

@rawwar rawwar removed the needs-triage label for new issues that we didn't triage yet label Oct 18, 2024
@potiuk
Copy link
Member

potiuk commented Oct 18, 2024

Yes. list of errors look good and we implemented it elsewhere already (i am quite sure I saw it in other operators). Having a method to pass, but if you implement the operator in the way that it has a public "should_retry(response)" method, then you should be able to implement your custom operator deriving from the base one and rewrite only that method - which is the way the operators should be extended with code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants