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

Side by Side Diff: server/server_job.py

Issue 3554003: Merge remote branch 'cros/upstream' into tempbranch3 (Closed) Base URL: http://git.chromium.org/git/autotest.git
Patch Set: Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « server/hosts/serial.py ('k') | tko/parsers/version_1.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 """ 1 """
2 The main job wrapper for the server side. 2 The main job wrapper for the server side.
3 3
4 This is the core infrastructure. Derived from the client side job.py 4 This is the core infrastructure. Derived from the client side job.py
5 5
6 Copyright Martin J. Bligh, Andy Whitcroft 2007 6 Copyright Martin J. Bligh, Andy Whitcroft 2007
7 """ 7 """
8 8
9 import getpass, os, sys, re, stat, tempfile, time, select, subprocess 9 import getpass, os, sys, re, stat, tempfile, time, select, subprocess
10 import traceback, shutil, warnings, fcntl, pickle, logging, itertools, errno 10 import traceback, shutil, warnings, fcntl, pickle, logging, itertools, errno
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 shutil.copyfile(CLIENT_WRAPPER_CONTROL_FILE, 535 shutil.copyfile(CLIENT_WRAPPER_CONTROL_FILE,
536 server_control_file) 536 server_control_file)
537 else: 537 else:
538 utils.open_write_close(server_control_file, control) 538 utils.open_write_close(server_control_file, control)
539 logging.info("Processing control file") 539 logging.info("Processing control file")
540 self._execute_code(server_control_file, namespace) 540 self._execute_code(server_control_file, namespace)
541 logging.info("Finished processing control file") 541 logging.info("Finished processing control file")
542 542
543 # no error occured, so we don't need to collect crashinfo 543 # no error occured, so we don't need to collect crashinfo
544 collect_crashinfo = False 544 collect_crashinfo = False
545 except: 545 except Exception, e:
546 try: 546 try:
547 logging.exception( 547 logging.exception(
548 'Exception escaped control file, job aborting:') 548 'Exception escaped control file, job aborting:')
549 self.record('INFO', None, None, str(e),
550 {'job_abort_reason': str(e)})
549 except: 551 except:
550 pass # don't let logging exceptions here interfere 552 pass # don't let logging exceptions here interfere
551 raise 553 raise
552 finally: 554 finally:
553 if temp_control_file_dir: 555 if temp_control_file_dir:
554 # Clean up temp directory used for copies of the control files 556 # Clean up temp directory used for copies of the control files
555 try: 557 try:
556 shutil.rmtree(temp_control_file_dir) 558 shutil.rmtree(temp_control_file_dir)
557 except Exception, e: 559 except Exception, e:
558 logging.warn('Could not remove temp directory %s: %s', 560 logging.warn('Could not remove temp directory %s: %s',
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 intervals = self.disabled_warnings.setdefault(warning_type, []) 1136 intervals = self.disabled_warnings.setdefault(warning_type, [])
1135 if not intervals or intervals[-1][1] is not None: 1137 if not intervals or intervals[-1][1] is not None:
1136 intervals.append((int(current_time_func()), None)) 1138 intervals.append((int(current_time_func()), None))
1137 1139
1138 1140
1139 def enable_warnings(self, warning_type, current_time_func=time.time): 1141 def enable_warnings(self, warning_type, current_time_func=time.time):
1140 """As of now, enables all further warnings of this type.""" 1142 """As of now, enables all further warnings of this type."""
1141 intervals = self.disabled_warnings.get(warning_type, []) 1143 intervals = self.disabled_warnings.get(warning_type, [])
1142 if intervals and intervals[-1][1] is None: 1144 if intervals and intervals[-1][1] is None:
1143 intervals[-1] = (intervals[-1][0], int(current_time_func())) 1145 intervals[-1] = (intervals[-1][0], int(current_time_func()))
OLDNEW
« no previous file with comments | « server/hosts/serial.py ('k') | tko/parsers/version_1.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698