Skip to content
Snippets Groups Projects
Commit 41593f6b authored by Guido Trotter's avatar Guido Trotter
Browse files

Remove job object condition


We don't need it anymore, since nobody waits on it.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 6c2549d6
No related branches found
No related tags found
No related merge requests found
...@@ -162,7 +162,6 @@ class _QueuedJob(object): ...@@ -162,7 +162,6 @@ class _QueuedJob(object):
@ivar start_timestmap: the timestamp for start of execution @ivar start_timestmap: the timestamp for start of execution
@ivar end_timestamp: the timestamp for end of execution @ivar end_timestamp: the timestamp for end of execution
@ivar lock_status: In-memory locking information for debugging @ivar lock_status: In-memory locking information for debugging
@ivar change: a Condition variable we use for waiting for job changes
""" """
# pylint: disable-msg=W0212 # pylint: disable-msg=W0212
...@@ -197,9 +196,6 @@ class _QueuedJob(object): ...@@ -197,9 +196,6 @@ class _QueuedJob(object):
# In-memory attributes # In-memory attributes
self.lock_status = None self.lock_status = None
# Condition to wait for changes
self.change = threading.Condition(self.queue._lock)
def __repr__(self): def __repr__(self):
status = ["%s.%s" % (self.__class__.__module__, self.__class__.__name__), status = ["%s.%s" % (self.__class__.__module__, self.__class__.__name__),
"id=%s" % self.id, "id=%s" % self.id,
...@@ -237,9 +233,6 @@ class _QueuedJob(object): ...@@ -237,9 +233,6 @@ class _QueuedJob(object):
obj.log_serial = max(obj.log_serial, log_entry[0]) obj.log_serial = max(obj.log_serial, log_entry[0])
obj.ops.append(op) obj.ops.append(op)
# Condition to wait for changes
obj.change = threading.Condition(obj.queue._lock)
return obj return obj
def Serialize(self): def Serialize(self):
...@@ -465,8 +458,6 @@ class _OpExecCallbacks(mcpu.OpExecCbBase): ...@@ -465,8 +458,6 @@ class _OpExecCallbacks(mcpu.OpExecCbBase):
self._job.log_serial += 1 self._job.log_serial += 1
self._op.log.append((self._job.log_serial, timestamp, log_type, log_msg)) self._op.log.append((self._job.log_serial, timestamp, log_type, log_msg))
self._queue.UpdateJobUnlocked(self._job, replicate=False) self._queue.UpdateJobUnlocked(self._job, replicate=False)
self._job.change.notifyAll()
finally: finally:
self._queue.release() self._queue.release()
...@@ -1297,9 +1288,6 @@ class JobQueue(object): ...@@ -1297,9 +1288,6 @@ class JobQueue(object):
logging.debug("Writing job %s to %s", job.id, filename) logging.debug("Writing job %s to %s", job.id, filename)
self._UpdateJobQueueFile(filename, data, replicate) self._UpdateJobQueueFile(filename, data, replicate)
# Notify waiters about potential changes
job.change.notifyAll()
def WaitForJobChanges(self, job_id, fields, prev_job_info, prev_log_serial, def WaitForJobChanges(self, job_id, fields, prev_job_info, prev_log_serial,
timeout): timeout):
"""Waits for changes in a job. """Waits for changes in a job.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment