Skip to content

fix: Retry on NeptuneRetryableError. Call on_async_lag_callback #99

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

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

michalsosn
Copy link
Contributor

NeptuneAsyncLagThresholdExceeded is a NeptuneScaleError, so when it was after NeptuneScaleError in the except block, the more general on_error_callback was called to handle this exception and on_async_lag_callback was a dead code

NeptuneRetryableError currently has 3 subclasses (NeptuneConnectionLostError, NeptuneUnexpectedResponseError, NeptuneInternalServerError)
NeptuneConnectionLostError is retried for 60 seconds with an exponential backoff, the other two subtypes simply triggered on_error_callback, which by default kills the sender process. It was possible to provide a custom on_error_callback to make them actually retriable, but with the default config they were simply fatal. I added them to the backoff instruction, so they are all handled in the same way, ie. retried for 60s and only afterwards the decision is delegated to the on_error_callback

Copy link
Contributor

@kgodlewski kgodlewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny nit with test name

@michalsosn michalsosn merged commit 27c8f84 into main Dec 3, 2024
10 checks passed
@michalsosn michalsosn deleted the ms/error-tracking-retryable-error branch December 3, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants