Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queue.dequeue_any breaks with a promise #10

Open
puttu opened this issue Feb 11, 2014 · 3 comments
Open

Queue.dequeue_any breaks with a promise #10

puttu opened this issue Feb 11, 2014 · 3 comments

Comments

@puttu
Copy link

puttu commented Feb 11, 2014

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)).

@syphar
Copy link

syphar commented Aug 8, 2014

@bretth is there a possible solution to this? this is crashing my workers.

@ghost
Copy link

ghost commented Aug 18, 2014

I have this problem fixed (for me anyway) on a fork. https://github.com/beachbc/django-pq

@syphar
Copy link

syphar commented Aug 18, 2014

@beachbc thanks for this, we'll have a look and probably do a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants