Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information