Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1382)

Unified Diff: appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py

Issue 2526963002: [Findit] Implement retry within swarming_util.py when making server calls (Closed)
Patch Set: Self-review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
diff --git a/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py b/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
index bae4096c6d5d0edd8e7bb787c44c99a1db310b93..f661e2e92cb0123f5aab46461b14deaec6b6410a 100644
--- a/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
+++ b/appengine/findit/waterfall/process_base_swarming_task_result_pipeline.py
@@ -88,11 +88,15 @@ class ProcessBaseSwarmingTaskResultPipeline(BasePipeline):
task_id, self.HTTP_CLIENT)
if error:
- # An error occurred when trying to contact the swarming server.
- task.status = analysis_status.ERROR
+ # An error occurred at some point when trying to retrieve data from
+ # the swarming server, even if eventually successful.
task.error = error
task.put()
- break
+
+ if not data:
+ # Even after retry, no data was recieved.
+ task.status = analysis_status.ERROR
chanli 2016/11/23 23:45:32 This status is not saved in data store?
lijeffrey 2016/11/28 23:55:24 This should be fine, outside the while loop there
chanli 2016/11/29 18:49:38 I just want to make it consistent. There is a task
lijeffrey 2016/11/30 18:18:47 I don't think the put() call belongs here, since i
chanli 2016/11/30 18:53:29 As discussed offline, this change is not needed.
+ break
task_state = data['state']
exit_code = (data.get('exit_code') if
@@ -110,11 +114,15 @@ class ProcessBaseSwarmingTaskResultPipeline(BasePipeline):
output_json, error = swarming_util.GetSwarmingTaskFailureLog(
outputs_ref, self.HTTP_CLIENT)
+ task.status = analysis_status.COMPLETED
+
if error:
- task.status = analysis_status.ERROR
task.error = error
- else:
- task.status = analysis_status.COMPLETED
+ task.put()
chanli 2016/11/23 23:45:32 This put is not necessary?
lijeffrey 2016/11/28 23:55:24 This can be a design choice, the idea is to captur
+
+ if not output_json:
chanli 2016/11/30 18:53:29 If not output_json, this task is actually failed a
lijeffrey 2016/11/30 20:12:11 Rebased. As discussed offline, it's possible we ge
+ # Retry was ultimately unsuccessful.
+ task.status = analysis_status.ERROR
tests_statuses = self._CheckTestsRunStatuses(output_json, *call_args)
chanli 2016/11/23 23:45:32 This line will affect ln 125, right?
chanli 2016/11/28 23:44:18 This comment is not valid, please ignore.
task.tests_statuses = tests_statuses

Powered by Google App Engine
This is Rietveld 408576698