Add executor-specific setup time support

This will allow us to make the setup time TTL for k8s-based builds much lower (on the order of a minute), which means faster timeouts and fallbacks (which is a better user experience).
This commit is contained in:
Joseph Schorr 2016-11-07 15:45:15 -05:00
parent 9aac68fbeb
commit ef41e57aad
3 changed files with 12 additions and 3 deletions

View file

@ -168,7 +168,7 @@ class BuilderServer(object):
logger.debug('Checking for more work for %d active workers',
self._lifecycle_manager.num_workers())
processing_time = self._lifecycle_manager.setup_time() + SETUP_LEEWAY_SECONDS
processing_time = self._lifecycle_manager.overall_setup_time() + SETUP_LEEWAY_SECONDS
job_item = self._queue.get(processing_time=processing_time, ordering_required=True)
if job_item is None:
logger.debug('No additional work found. Going to sleep for %s seconds', WORK_CHECK_TIMEOUT)