Skip to content

[4.3] Don't close stale connections while in use - #632

Merged
robsdedude merged 2 commits into
neo4j:4.3from
robsdedude:fix-dont-close-in-use-stale-connections-4.3
Dec 17, 2021
Merged

robsdedude merged 2 commits into
neo4j:4.3from
robsdedude:fix-dont-close-in-use-stale-connections-4.3

Conversation

@robsdedude

Copy link
Copy Markdown
Member

The pool will close connections marked as stale when trying to pick them up
from the pool. It should not do so while the connection is in use (i.e.,
already borrowed from the pool). In concurrent systems, this would lead to all
sorts of errors caused by the connection being managed from different threads:

  • the thread trying to acquire a connection will close the stale connection on
    encounter
  • while the thread that borrowed it might still be using it, e.g., to fetch
    results or run a query

The pool will close connections marked as stale when trying to pick them up
from the pool. It should not do so while the connection is in use (i.e.,
already borrowed from the pool). In concurrent systems, this would lead to all
sorts of errors caused by the connection being managed from different threads:
 * the thread trying to acquire a connection will close the stale connection on
   encounter
 * while the thread that borrowed it might still be using it, e.g., to fetch
   results or run a query

@bigmontz bigmontz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐍

@robsdedude
robsdedude merged commit 6aa15c2 into neo4j:4.3 Dec 17, 2021
@robsdedude
robsdedude deleted the fix-dont-close-in-use-stale-connections-4.3 branch December 17, 2021 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants