Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing connection cleanup in case of mass connection breaking. #2614

Commits on May 21, 2024

  1. Fixing connection cleanup in case of mass connection breaking.

     CAUSE:
     In some cases when credentials expire, or servers encounters a
     blip and closes all connections. The driver gets close message on all
     connections. While processing those close messages, the driver was
     getting into race conditions, where in multiple threads were trying to
     close connections and trying to update the connections object i.e. list
     of connections in the pool. This was leading to uncaught exceptions and
     stale connections in the pool. These connections are never cleanedup
     post this.
    
     FIX:
     Iterate the connections list while creating the connectionPool Info.
     Since the list used is copyOnWrite, the iterator API creates a clone
     and uses that clone for referring the element. Thus providing thread
     safe interface.
    
     However the information provided by this iteration is a bit stale, but
     this doesn't matter.
    upadhyay-prashant committed May 21, 2024
    Configuration menu
    Copy the full SHA
    424406f View commit details
    Browse the repository at this point in the history