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

Unified Diff: appengine/swarming/server/task_result.py

Issue 2914803004: Fix non-idempotent task that /poll reaped but returned HTTP 500. (Closed)
Patch Set: Rebase on 2927053002 to reduce delta Created 3 years, 6 months 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/swarming/server/task_result.py
diff --git a/appengine/swarming/server/task_result.py b/appengine/swarming/server/task_result.py
index c16390287c9112658a62b0038bd6bb5591d9b6dc..2c324c53ad75778ad1c72dc350447d544a1df108 100644
--- a/appengine/swarming/server/task_result.py
+++ b/appengine/swarming/server/task_result.py
@@ -83,8 +83,10 @@ from server import task_request
import cipd
# Amount of time after which a bot is considered dead. In short, if a bot has
-# not ping in the last 5 minutes while running a task, it is considered dead.
-BOT_PING_TOLERANCE = datetime.timedelta(seconds=5*60)
+# not ping in the last 2 minutes while running a task, it is considered dead.
+#
+# task_runner.MAX_PACKET_INTERVAL is 30 seconds.
+BOT_PING_TOLERANCE = datetime.timedelta(seconds=2*60)
class State(object):
@@ -741,6 +743,11 @@ class TaskRunResult(_TaskResultCommon):
out['try_number'] = self.try_number
return out
+ def _pre_put_hook(self):
+ super(TaskRunResult, self)._pre_put_hook()
+ if not self.started_ts:
+ raise datastore_errors.BadValueError('Must update .started_ts')
+
class TaskResultSummary(_TaskResultCommon):
"""Represents the overall result of a task.
@@ -1168,7 +1175,6 @@ def new_run_result(request, try_number, bot_id, bot_version, bot_dimensions):
summary_key, try_number),
bot_dimensions=bot_dimensions,
bot_id=bot_id,
- started_ts=utils.utcnow(),
bot_version=bot_version,
server_versions=[utils.get_app_version()])
« no previous file with comments | « no previous file | appengine/swarming/server/task_result_test.py » ('j') | appengine/swarming/server/task_scheduler.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698