Giter Club home page Giter Club logo

Comments (6)

pierre avatar pierre commented on July 20, 2024

We thought we didn't need to take the lock anymore (see 40662f3), since we introduced the implementation using a notification queue.

But it looks like we can still have concurrent jobs racing against each other: if two different entries (e.g. ACCOUNT_CREATION and PAYMENT_FAILED events) are picked up by two different threads on the same node for example.

To fix this, we can either:

  • re-introduce the lock
  • leverage the new getInProcessingNotifications queue API to delay the processing of an event for an account being refreshed already

from killbill-analytics-plugin.

sbrossie avatar sbrossie commented on July 20, 2024

If we go with 'lock' option, what we probably need is a new API tryLock. The first thread does tryLock, succeeds and proceeds. The second does tryLock, fails, and abort (since other thread is already refreshing data.

If we go with getInProcessingNotifications, i suppose we getInProcessingNotifications returns results for a given account_record_id we can also abort that refresh

from killbill-analytics-plugin.

pierre avatar pierre commented on July 20, 2024

we can also abort that refresh

We actually cannot abort, because we don't always do full refreshes (we do smart™ refreshes now!). But we could simply delay or postpone the job for that account.

from killbill-analytics-plugin.

sbrossie avatar sbrossie commented on July 20, 2024

Ah.. so refresh do not recreate the whole state for the account (just the pieces needed? )

from killbill-analytics-plugin.

pierre avatar pierre commented on July 20, 2024

As far as we can, yes: https://github.com/killbill/killbill-analytics-plugin/blob/master/src/main/java/org/killbill/billing/plugin/analytics/AnalyticsListener.java#L203

from killbill-analytics-plugin.

pierre avatar pierre commented on July 20, 2024

@kevinpostlewaite Have you tried the latest version? Did it help?

from killbill-analytics-plugin.

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.