Revision fcb21ad7 lib/jqueue.py
b/lib/jqueue.py | ||
---|---|---|
1340 | 1340 |
CONTINUE, |
1341 | 1341 |
WRONGSTATUS) = range(1, 6) |
1342 | 1342 |
|
1343 |
# TODO: Export waiter information to lock monitor |
|
1344 |
|
|
1345 | 1343 |
def __init__(self, getstatus_fn, enqueue_fn): |
1346 | 1344 |
"""Initializes this class. |
1347 | 1345 |
|
... | ... | |
1353 | 1351 |
self._lock = locking.SharedLock("JobDepMgr") |
1354 | 1352 |
|
1355 | 1353 |
@locking.ssynchronized(_LOCK, shared=1) |
1354 |
def GetLockInfo(self, requested): # pylint: disable-msg=W0613 |
|
1355 |
"""Retrieves information about waiting jobs. |
|
1356 |
|
|
1357 |
@type requested: set |
|
1358 |
@param requested: Requested information, see C{query.LQ_*} |
|
1359 |
|
|
1360 |
""" |
|
1361 |
# No need to sort here, that's being done by the lock manager and query |
|
1362 |
# library. There are no priorities for notifying jobs, hence all show up as |
|
1363 |
# one item under "pending". |
|
1364 |
return [("job/%s" % job_id, None, None, |
|
1365 |
[("job", [job.id for job in waiters])]) |
|
1366 |
for job_id, waiters in self._waiters.items() |
|
1367 |
if waiters] |
|
1368 |
|
|
1369 |
@locking.ssynchronized(_LOCK, shared=1) |
|
1356 | 1370 |
def JobWaiting(self, job): |
1357 | 1371 |
"""Checks if a job is waiting. |
1358 | 1372 |
|
... | ... | |
1527 | 1541 |
# Job dependencies |
1528 | 1542 |
self.depmgr = _JobDependencyManager(self._GetJobStatusForDependencies, |
1529 | 1543 |
self._EnqueueJobs) |
1544 |
self.context.glm.AddToLockMonitor(self.depmgr) |
|
1530 | 1545 |
|
1531 | 1546 |
# Setup worker pool |
1532 | 1547 |
self._wpool = _JobQueueWorkerPool(self) |
Also available in: Unified diff