ingest retry strategy refactor#1708
Conversation
1a4eec7 to
3a6962a
Compare
|
so where we were headed with wrapping / raising those custom errors was that one could catch connection errors and re-run outside of the call to the ingest doc. then the code in the ingest doc itself could be somewhat agnostic to retry logic. obviously notion was a bit of a special case since it has tons of nested internal calls...also maybe not all connection errors necessarily make sense to retry? wondering if a: this still makes sense to consider and b: we need to specify some kind of retry-worthy error. |
Some concerns about this, if we move it out of the ingest doc class, then the code that we would be retrying would be the entire If we're fine with that additional overhead, I can isolate the network calls and wrap that in a specific custom error to indicate it's something that should be retried. |
yea, totally understood and agreed. I think in a majority of cases that extra logic is going to be nominal. for instance, with the airbyte connector you updated here afaict in |
5b2df86 to
38c7809
Compare
38c7809 to
3c32da2
Compare
| def add_cli_options(cmd: click.Command) -> None: | ||
| options = [ | ||
| click.Option( | ||
| ["--max-tries"], |
There was a problem hiding this comment.
can we can call this max-retries as you had it before? I think this makes it clear it's tied to retry logic
| "back off strategy if http calls fail", | ||
| ), | ||
| click.Option( | ||
| ["--max-time"], |
There was a problem hiding this comment.
max-retry-time? (so it's clear this is specifically about retry
| pass | ||
|
|
||
|
|
||
| class CliRetryStrategyConfig(RetryStrategyConfig, CliMixin): |
There was a problem hiding this comment.
depending on sequencing of PRs, just want to make sure this is also captured in documentation at some point.
ryannikolaidis
left a comment
There was a problem hiding this comment.
nit on naming otherwise lgtm
6414034 to
1713bf6
Compare
1713bf6 to
9fe74f4
Compare
Description
Pivot from using the retry logic as a decorator as this posed too many limitations on what can be passed in as a parameter at runtime. Moved this to be a class approach and now that can be instantiated with appropriate loggers leveraging the
--verboseflag to set the log level. This also mitigates how much new code is being forked from the backoff library. The existing notion client that was using the previous decorator has been refactored to use the new class approach and the airtable connector was updated to support retry logic as well. Default log handlers were introduced which applies to all instances of the retry handler when it starts, backs off, and gives up.A generic approach was added to configuring the retry parameters in the CLI and was added to the running number of common configs across all CLI commands.
Omitted CHANGELOG entry as this is mostly just a refactor of the retry code. All other connectors will be updated to support retry in another PR but this helps limit the number of changes to review in this one.
Extra fixes
ingest_doc_clsin a__post_init__method since this variable can't be serialized.Testing
Both the airtable and notion ingest tests can be run locally. While they might not pass due to text changes (to be expected when running locally), the process can be viewed in the logs to validate.
Associated issue: #1488