Make the redis client use AsyncWrapper and coroutines
Change all log messages to be synchronous
This commit is contained in:
parent
5935e93eb8
commit
f0ef4347e5
8 changed files with 76 additions and 57 deletions
|
@ -58,7 +58,7 @@ class BaseManager(object):
|
|||
@coroutine
|
||||
def job_completed(self, build_job, job_status, build_component):
|
||||
""" Method invoked once a job_item has completed, in some manner. The job_status will be
|
||||
one of: incomplete, error, complete. Implementations of this method should call
|
||||
one of: incomplete, error, complete. Implementations of this method should call coroutine
|
||||
self.job_complete_callback with a status of Incomplete if they wish for the job to be
|
||||
automatically requeued.
|
||||
"""
|
||||
|
|
|
@ -79,7 +79,7 @@ class EnterpriseManager(BaseManager):
|
|||
|
||||
@coroutine
|
||||
def job_completed(self, build_job, job_status, build_component):
|
||||
self.job_complete_callback(build_job, job_status)
|
||||
yield From(self.job_complete_callback(build_job, job_status))
|
||||
|
||||
def build_component_disposed(self, build_component, timed_out):
|
||||
self.all_components.remove(build_component)
|
||||
|
|
|
@ -201,8 +201,8 @@ class EphemeralBuilderManager(BaseManager):
|
|||
if got_lock:
|
||||
logger.error('[BUILD INTERNAL ERROR: etcd %s] Build ID: %s. Exec name: %s. Exec ID: %s',
|
||||
etcd_result.action, build_job.build_uuid, executor_name, execution_id)
|
||||
self.job_complete_callback(build_job, BuildJobResult.INCOMPLETE, executor_name,
|
||||
update_phase=True)
|
||||
yield From(self.job_complete_callback(build_job, BuildJobResult.INCOMPLETE, executor_name,
|
||||
update_phase=True))
|
||||
|
||||
# Finally, we terminate the build execution for the job. We don't do this under a lock as
|
||||
# terminating a node is an atomic operation; better to make sure it is terminated than not.
|
||||
|
@ -585,7 +585,7 @@ class EphemeralBuilderManager(BaseManager):
|
|||
# to ask for the phase to be updated as well.
|
||||
build_info = self._build_uuid_to_info.get(build_job.build_uuid, None)
|
||||
executor_name = build_info.executor_name if build_info else None
|
||||
self.job_complete_callback(build_job, job_status, executor_name, update_phase=False)
|
||||
yield From(self.job_complete_callback(build_job, job_status, executor_name, update_phase=False))
|
||||
|
||||
# Kill the ephemeral builder.
|
||||
yield From(self.kill_builder_executor(build_job.build_uuid))
|
||||
|
|
Reference in a new issue