When testing pq out I've managed to break it by adding a job scheduled for the future and right next enqueuing an immediate one. This resulted in this partial stack:
File "/Users/m/Dropbox/projects/tlink/pq/worker.py", line 313, in work
result = self.dequeue_job_and_maintain_ttl(timeout)
File "/Users/m/Dropbox/projects/tlink/pq/worker.py", line 352, in dequeue_job_and_maintain_ttl
return PQ.dequeue_any(self.queues, timeout)
File "/Users/m/Dropbox/projects/tlink/pq/queue.py", line 360, in dequeue_any
if q.serial and not q.acquire_lock(timeout):
AttributeError: 'unicode' object has no attribute 'serial'
It seems to be caused by the fact that Job._get_job_or_promise returns job.queue_id as the promise, while Queue.dequeue_any expects a Queue object when it adds it to stack (queue_stack.append(promise)).
When testing pq out I've managed to break it by adding a job scheduled for the future and right next enqueuing an immediate one. This resulted in this partial stack:
It seems to be caused by the fact that
Job._get_job_or_promisereturnsjob.queue_idas the promise, whileQueue.dequeue_anyexpects aQueueobject when it adds it to stack (queue_stack.append(promise)).