-
Notifications
You must be signed in to change notification settings - Fork 71
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: RESTStream not retrying in TimeoutError #2643
Comments
Hi @hudovisk 👋 Retriable exceptions are hard-coded in sdk/singer_sdk/streams/rest.py Lines 249 to 263 in 640e00b
There's no straightforward mechanism in the SDK to extend them like there is for other backoff features but I can think of something like class RESTStream(...):
backoff_exceptions: tuple[type[Exception], ...] = (
ConnectionResetError,
RetriableAPIError,
requests.exceptions.ReadTimeout,
requests.exceptions.ConnectionError,
requests.exceptions.ChunkedEncodingError,
requests.exceptions.ContentDecodingError,
)
def request_decorator(self, func: t.Callable) -> t.Callable:
decorator: t.Callable = backoff.on_exception(
self.backoff_wait_generator,
self.backoff_exceptions,
max_tries=self.backoff_max_tries,
on_backoff=self.backoff_handler,
jitter=self.backoff_jitter,
)(func)
return decorator then it could be extended as class MyStream(RESTStream):
backoff_exceptions = RESTStream.backoff_exceptions + (requests.exceptions.Timeout,) We could also just add whatever exception you're running into if we decide it's common enough. Or we could do both the extensibility piece and add a new retriable exception. |
Hey @edgarrmondragon, is there any method that I can override and re-raise the exception as |
Maybe |
Singer SDK Version
0.39
Is this a regression?
Python Version
3.9
Bug scope
Taps (catalog, state, etc.)
Operating System
Linux
Description
We have a RESTStream that eventually fails due to a timeout error, but the SDK does not retry it with proper backoff (you can see it by the timestamp of the logs). The timeout error is unhandled. Is there any additional configuration needed in the tap code?
Here are the logs:
Logs
kind: password
is deprecated for setting definitions in favour ofsensitive: true
, and is currently in use by the following settings of loader 'target-postgres': 'password'. Please open an issue or pull request to update the plugin definition on Meltano Hub at https://github.com/meltano/hub/blob/main/_data/meltano/loaders/target-postgres/transferwise.yml.Code
TAP:
Stream:
Link to Slack/Linen
No response
The text was updated successfully, but these errors were encountered: