Skip to content

Multiple workers reserved the same tickets #13

Description

@tfMovamo

Hello,
Unfortunately, I can't tell if it's a general beanstalk problem, a bug in here, or in my script.

I have 20 or more workers running (Python 3.6) who get tickets from a tube.


self.beanstalkdConnection.use('imageupload')
self.beanstalkdConnection.watch('imageupload')
self.beanstalkdConnection.ignore('default')

ticket = self.beanstalkdConnection.reserve(1)

if ticket is None:
            print('no jobs')
            return None
else:
            ticketId = ticket.stats().get('id')
            
            if self.mclient.get(str(ticketId)) == None:
                self.mclient.set(str(ticketId), 'in_work', 60)
            else:
                print('no jobs - ticket ' + str(ticketId) + " in progress")
                return None

            ticket.touch()
            self.progress(ticket)
            ticket.delete()

worker 1 reserved the ticket, but all other (19 workers) will reserved this ticket too and give out: 'no jobs - ticket xxxx in progress".

The ttl for an ticket is 500 when i put it into the queue.

Am I doing something wrong? Or is there actually a bug?

greets
Timo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions