Code Monkey home page Code Monkey logo

Comments (5)

huumn avatar huumn commented on September 26, 2024 1

No need to randomize them. Just offset them so nothing that might take a long time runs at the same time.

We can't retry rewards as-is. They aren't atomic.

from stacker.news.

ekzyis avatar ekzyis commented on September 26, 2024 1

No need to randomize them. Just offset them so nothing that might take a long time runs at the same time.

Also good idea. I forgot that we don't have the exact same situation here. At my previous position, I had the idea to randomize since we never knew when our servers are going to get hit by a huge wave of automated abuse reports in bulk, not realizing they are actually DDOSing our servers, trying to process all these bulk abuse reports at once, lol. here, we don't have such consistent load with huge spikes of incoming requests, I guess

We can't retry rewards as-is. They aren't atomic.

Oh, right, that would be a bad idea, lol

from stacker.news.

huumn avatar huumn commented on September 26, 2024

Yeah this appears to be caused by us timing out waiting for a connection from prisma's connection pool. I'd guess the worker picked to run rewards is occasionally running other long running tasks. Both rewards and historical materialized views are both scheduled to run at exactly midnight.

from stacker.news.

ekzyis avatar ekzyis commented on September 26, 2024

So solution might be to just add retry (for now)? I think you mentioned that to me once

I used to have similar problems at my previous position and it took us really long to fix.

One solution I brought up was to randomize when the queries run so not all our REFRESH MATERIALIZED VIEW CONCURRENTLY want to start at exactly the same time but we never did that for some reason

So maybe just do this? Randomize the query starts? Like +-1 hour?

from stacker.news.

huumn avatar huumn commented on September 26, 2024

This specific issue should be fixed in 628f755

from stacker.news.

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.