Commit 46d0a3d0 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

workerpool: Don't keep reference to task arguments

The workerpool should not keep any reference to task arguments after
they were processed by RunTask. Doing so led to jobs being cached
by the job queue's WeakValueDictionary for longer than they should've
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarManuel Franceschini <>
parent 5d297d8a
......@@ -78,9 +78,8 @@ class BaseWorker(threading.Thread, object):
pool = self.pool
assert self._current_task is None
while True:
assert self._current_task is None
# Wait on lock to be told either to terminate or to do a task
......@@ -97,7 +96,11 @@ class BaseWorker(threading.Thread, object):
self._current_task = task
# No longer needed, dispose of reference
del task
assert self._HasRunningTaskUnlocked()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment