Git Product home page Git Product logo

Comments (5)

alexfiennes avatar alexfiennes commented on September 22, 2024

I've been doing more local testing and seeing what happens if we just have perform_async rather than perform_in so that the run order is more roughly the same as the enqueue order, and I have not been able to reproduce a situation where the callback is called before any instance of each of the nested jobs has run. So I suspect that the trick is to not combine unique_for and batches and perform_in and things will be more safe.

from sidekiq.

mperham avatar mperham commented on September 22, 2024

All of this is As Designed. Uniqueness and batches often don't play well together.

from sidekiq.

alexfiennes avatar alexfiennes commented on September 22, 2024

Mike - this is kind of the conclusion that I came to as well. How easy would it be within the current architecture to make it so that if you add a job to a batch which is declared as unique that it would raise an exception or log a warning? I'm happy to do my best to avoid doing this, but if someone changed the behaviour of a job without realising that other people were using it in a batch then this might cause hard-to-spot errors - it would be nice if we got a nice clear warning that this was happening?

from sidekiq.

mperham avatar mperham commented on September 22, 2024

Uniqueness is a sharp knife, that’s why the batch wiki page warns the reader about it, but logging a warning would be useful the first time but annoying every other time.

from sidekiq.

alexfiennes avatar alexfiennes commented on September 22, 2024

I am toying with recording an expiring key in REDIS each time a job completes that is unique by it's input params. Then when a new job starts up it can check to see whether the same job has completed which started after the current job was enqueued and if so then just returning as a noop. That way we can intermix batches and this-form-of-uniqueness without a problem.

from sidekiq.

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.