Giter VIP home page Giter VIP logo

Comments (4)

georaldc avatar georaldc commented on July 21, 2024

So I realized that this problem still occurs even with just a single worker watching a tube (it just gets compounded with multiple workers). Looking at the code, I believe this occurs because of what's happening here:

https://github.com/ptrofimov/beanstalk_console/blob/1.7.7/lib/include.php#L765

If I bury a job immediately like in my sample code, it's possible for the do/while loop here to pick it up again ($job = $this->interface->_client->useTube($tube)->peekBuried();) before it is able to exit out via throwing a Pheanstalk_Exception_ServerException exception from not finding any jobs. That explains why I only see 1 buried job, despite it being executed and buried more than once. I'm guessing this a race condition type of problem?

from beanstalk_console.

pentium10 avatar pentium10 commented on July 21, 2024

How I see is:

  • you have a worker listening for new jobs (and as you say bury them immediately)
  • you click move ALL from Bury to Ready
  • loop clicks in to peek all Bury
  • identifies a buried N1, creates a copy puts to ready N2
  •  workers takes the new copy N2 and buries as N2 
    
  • loop deletes the buried N1 and loops again (since there is a new bury N2 already in place as the worker did created meanwhile the bury it keeps doing this)

I think you should pause the tube and then click the buttons. Otherwise because your workers are too fast, the console cannot do it's thing correctly.

from beanstalk_console.

georaldc avatar georaldc commented on July 21, 2024

That basically sums it up. I guess there are ways around it (like your suggestion of pausing) but that can be quite a hassle. If this is expected behavior, then this issue can be closed.

from beanstalk_console.

pentium10 avatar pentium10 commented on July 21, 2024

we cannot build around your logic, actually your logic of fast bury makes you this behaivior

from beanstalk_console.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.