[
https://issues.apache.org/jira/browse/BEAM-13463?focusedWorklogId=698969&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-698969
]
ASF GitHub Bot logged work on BEAM-13463:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 20/Dec/21 20:44
Start Date: 20/Dec/21 20:44
Worklog Time Spent: 10m
Work Description: KonradJanica commented on a change in pull request
#16244:
URL: https://github.com/apache/beam/pull/16244#discussion_r772642955
##########
File path:
playground/frontend/lib/modules/editor/repository/code_repository/code_client/grpc_code_client.dart
##########
@@ -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('')));
Review comment:
There should be a logger in the `catchError` so that we can find
potential problems.
##########
File path: playground/frontend/lib/utils/run_with_retry.dart
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const kDefaultRetryCount = 5;
+const kDefaultRetryWaitMs = 2000;
+
+Future<T> runWithRetry<T>(Future<T> Function() fn,
Review comment:
Nit: Explain this API by adding a [doc
comment](https://dart.dev/guides/language/effective-dart/documentation#prefer-writing-doc-comments-for-public-apis).
##########
File path: playground/frontend/lib/utils/run_with_retry.dart
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+const kDefaultRetryCount = 5;
+const kDefaultRetryWaitMs = 2000;
+
+Future<T> runWithRetry<T>(Future<T> Function() fn,
+ {int retryCount = kDefaultRetryCount,
+ int retryWaitMs = kDefaultRetryWaitMs,
+ int attemptNumber = 1}) async {
Review comment:
`attemptNumber` should not be exposed to the caller. Perhaps move the
recursion to a nested helper function or create a class with private functions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 698969)
Time Spent: 20m (was: 10m)
> [Playground] Add retries to check status
> ----------------------------------------
>
> Key: BEAM-13463
> URL: https://issues.apache.org/jira/browse/BEAM-13463
> Project: Beam
> Issue Type: Task
> Components: beam-playground
> Reporter: Artur Khanin
> Assignee: Aydar Farrakhov
> Priority: P2
> Labels: beam-playground-beta-launch, beam-playground-frontend,
> beam-playground-sprint-5
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Add 5 retries to check status request with equal interval between them –
> total time of retries 10 sec.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)