Add a mechanism to automatically retry failed tasks #1291
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1289
This is a first draft - it still needs API doc and tests.
As noted in #1289 this uses wrappers around
ResponseFuture
andFunctionExecutor
. I considered using subclasses, but that wasn't possible forResponseFuture
becauseRetryingFuture
updates the underlyingResponseFuture
for each retry. AndFunctionExecutor
already has subclasses (LocalhostExecutor
,ServerlessExecutor
, andStandaloneExecutor
), so that wasn't possible either.It might be possible to add the retry logic directly into the existing
ResponseFuture
andFunctionExecutor
classes, but I'm not familiar enough with the internals, so I wasn't sure how easy that would be or if it's even desirable. @JosepSampe what do you think?The current implementation in this PR also lacks some of the methods that
FunctionExecutor
has:call_async
,map_reduce
, andget_result
. It would be possible to add these (probably later), but I haven't needed them so I haven't spent any time looking at what's needed.Developer's Certificate of Origin 1.1