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
[BEAM-13463] [Playground] add retries to check status for run code #16244
Conversation
@@ -83,13 +83,14 @@ class GrpcCodeClient implements CodeClient { | |||
) { | |||
return _runSafely(() => createClient(request.sdk) | |||
.getRunOutput(grpc.GetRunOutputRequest(pipelineUuid: pipelineUuid)) | |||
.then((response) => _toOutputResponse(response.output))); | |||
.then((response) => _toOutputResponse(response.output)) | |||
.catchError((err) => _toOutputResponse(''))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be a logger in the catchError
so that we can find potential problems.
Future<T> runWithRetry<T>(Future<T> Function() fn, | ||
{int retryCount = kDefaultRetryCount, | ||
int retryWaitMs = kDefaultRetryWaitMs, | ||
int attemptNumber = 1}) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attemptNumber
should not be exposed to the caller. Perhaps move the recursion to a nested helper function or create a class with private functions.
const kDefaultRetryCount = 5; | ||
const kDefaultRetryWaitMs = 2000; | ||
|
||
Future<T> runWithRetry<T>(Future<T> Function() fn, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Explain this API by adding a doc comment.
# Conflicts: # playground/frontend/lib/modules/editor/repository/code_repository/code_repository.dart
LGTM thanks all! |
I added retries for check statuses on run code (https://issues.apache.org/jira/browse/BEAM-13463).
Added 5 retries to check status request with equal interval between them (2 seconds).
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).[BEAM-XXX] Fixes bug in ApproximateQuantiles
, where you replaceBEAM-XXX
with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
ValidatesRunner
compliance status (on master branch)Examples testing status on various runners
Post-Commit SDK/Transform Integration Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.