Log lock waits for task adding in WorkerManager

This commit is contained in:
shortcutme 2019-12-21 02:56:42 +01:00
parent 7ca09ba75b
commit 0881e274a9
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
2 changed files with 26 additions and 1 deletions

View file

@ -9,6 +9,7 @@ from .WorkerTaskManager import WorkerTaskManager
from Config import config
from util import helper
from Plugin import PluginManager
from Debug.DebugLock import DebugLock
import util
@ -20,7 +21,7 @@ class WorkerManager(object):
self.workers = {} # Key: ip:port, Value: Worker.Worker
self.tasks = WorkerTaskManager()
self.next_task_id = 1
self.lock_add_task = gevent.lock.Semaphore(1)
self.lock_add_task = DebugLock()
# {"id": 1, "evt": evt, "workers_num": 0, "site": self.site, "inner_path": inner_path, "done": False, "optional_hash_id": None,
# "time_started": None, "time_added": time.time(), "peers": peers, "priority": 0, "failed": peer_ids, "lock": None or gevent.lock.RLock}
self.started_task_num = 0 # Last added task num