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

Unified Diff: appengine/swarming/swarming_bot/bot_code/task_runner.py

Issue 1342673003: Significant refactoring of run_isolated. (Closed) Base URL: git@github.com:luci/luci-py.git@master
Patch Set: . Created 5 years, 3 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
« no previous file with comments | « no previous file | client/run_isolated.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/swarming/swarming_bot/bot_code/task_runner.py
diff --git a/appengine/swarming/swarming_bot/bot_code/task_runner.py b/appengine/swarming/swarming_bot/bot_code/task_runner.py
index 4a2f77eb4a8c8e1942dcbd512a9920a963db6ad8..b16c27b782099f0168f202b50192033cc8ed67d4 100644
--- a/appengine/swarming/swarming_bot/bot_code/task_runner.py
+++ b/appengine/swarming/swarming_bot/bot_code/task_runner.py
@@ -412,10 +412,26 @@ def run_command(
params['hard_timeout'] = had_hard_timeout
if isolated_result:
try:
+ # See run_isolated.py for the format.
with open(isolated_result, 'rb') as f:
- params['outputs_ref'] = json.load(f)
+ run_isolated_result = json.load(f)
+ logging.debug('run_isolated:\n%s', run_isolated_result)
+ # TODO(maruel): Grab statistics (cache hit rate, data downloaded,
+ # mapping time, etc) from run_isolated and push them to the server.
+ params['outputs_ref'] = run_isolated_result['outputs_ref']
+ if run_isolated_result['internal_failure']:
+ must_signal_internal_failure = run_isolated_result['internal_failure']
+ logging.error('%s', must_signal_internal_failure)
+ elif exit_code:
+ # TODO(maruel): Grab stdout from run_isolated.
+ must_signal_internal_failure = (
+ 'run_isolated internal failure %d' % exit_code)
+ logging.error('%s', must_signal_internal_failure)
+ exit_code = run_isolated_result['exit_code']
except (IOError, OSError, ValueError) as e:
- logging.error('Swallowing error: %s' % e)
+ logging.error('Swallowing error: %s', e)
+ # TODO(maruel): Send the internal failure here instead of sending it through
+ # bot_main, this causes a race condition.
post_update(swarming_server, params, exit_code, stdout, output_chunk_start)
return {
u'exit_code': exit_code,
« no previous file with comments | « no previous file | client/run_isolated.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698