Giter Club home page Giter Club logo

Comments (4)

abc3 avatar abc3 commented on May 13, 2024

I believe that the db_handler should reset the "caller" value after ready_for_query because there can be a situation where the client is linked with another database process, and the old one will continue to send messages.

from supavisor.

acco avatar acco commented on May 13, 2024

@abc3 I can take a stab at this with a bit more info. Are you imagining that while the Client may have "moved on" and is now associated with a new db_handler, the old db_handler - which still has messages incoming for the Client - would stay associated to the Client?

The difficulty I see is I'm not sure how we'll know that the db_handler is done responding to a Client. In a pipelined query, as I mentioned above, we have one incoming request from the Client that is going to instigate two separate db_handler responses, the first of which contains a ready_for_query.

from supavisor.

abc3 avatar abc3 commented on May 13, 2024

Sorry for the late response, it has been a tough week. According to the PostgreSQL documentation, ready_for_query indicates that the cycle is finished and the current database pool is ready for new queries.

So, after receiving this message, we can be sure that the client's query is finished. We should then clean up data.caller to avoid scenarios where DbHandler might receive an asynchronous message and forward it to the last linked client.

Would you like to implement this change?

from supavisor.

abc3 avatar abc3 commented on May 13, 2024

fixed in #207

from supavisor.

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.