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

Multiple worker #35

Open
DarkSorrow opened this issue Jun 22, 2015 · 3 comments
Open

Multiple worker #35

DarkSorrow opened this issue Jun 22, 2015 · 3 comments

Comments

@DarkSorrow
Copy link

Hello,

I'm running two workers on the same tube with different ID tho using the fiverunner, but it seems that sometime both worker are trying to process the same job. From what i understood this shouldn't be possible because once a worker reserve the job the other isn't suppose to get the job as well no?

And i tested with different jobs being put on the tube and it seems to be a bit random the fact that both worker are trying to process the same job.

@danielnielsen
Copy link

Are you using the reserve function when picking up a job?

@DarkSorrow
Copy link
Author

I just started two runner with different client_id and when i tried to write the event "job.reserved" it both were reserving the same id job at about the same time. So i suppose that the runner itself do make a reserver before calling right?

Thats what i use in two different files, its really basic:

var runner = new FiveBeans.runner('SpoolerWorkerDefault', 'spooler_worker.yml');
runner.go();

var runner = new FiveBeans.runner('SpoolerWorkerSecond', 'spooler_worker.yml');
runner.go();

@sirhanshafahath
Copy link

Hello,

I am also facing this issue. Its because of the TTL of the job.

We should keep 'touch'ing the job in the handler's work function until the job is completed. Otherwise after reserving the job, it will be released back into the queue by beanstalkd server, if the job is not completed in the specified TTL in the put command.

Once its released, it will be reserved by the second worker.

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

3 participants