Giter Site home page Giter Site logo

Comments (3)

akc42 avatar akc42 commented on May 29, 2024

I just conducted an experiment by switching on logging and also adding a line to log the connection acquired (it would be useful if always did this). With the debugging on, I can see that it closed an idle connection and then handed it to me on the next acquire. My request then immediately failed with "Requests can only be made in the Logged In state"

from tedious-connection-pool.

akc42 avatar akc42 commented on May 29, 2024

Done a bit of debugging on this with my own copy. There main issue is that there is a gap between the idle timeout being called and the connection end event being emitted. In that gap the status of the pool for this connection is FREE. As a result new requests can pick this connection up that is in the process of closing and try and re-use them.

The reason that I am seeing the problem quite frequently however (normally a request to close and the end event are very close together) is that once a connection has been used and the reset been called it does not seem to emit the end event. With debug log on, I can see the reset but never see the end. Is the a tedious issue?

from tedious-connection-pool.

akc42 avatar akc42 commented on May 29, 2024

OK, all understood now.

The reason I was not seeing the connection end was I had removed all listeners from the connection at the end of the request. So this was making the gap between timing out and closing the connection, and this connection being removed from the connection pool infinitely long. This was a bug on my part and I have fixed it.

I am not sure if there is a gap now between the connection close from the timeout and the connection end being omitted, but why take the chance. I have issued a pull request ( #31 ) that closes that small hole.

In getting to the bottom of this I found it immensely helpful to also know when a connection was acquired, so I have added another pull request #30 which adds that additional line to the logging.

I'll close this issue now

from tedious-connection-pool.

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.