Skip to content

Fix pool connection ownership #732

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

Merged
merged 2 commits into from
Jun 1, 2022

Conversation

robsdedude
Copy link
Member

@robsdedude robsdedude commented May 31, 2022

Fixing and testing two faulty corner-cases

  • When a connection fails, all idle connections to that host will be closed.
    If their closure fails, the same action is invoked recursively while being
    in the process of closing idle connections already. This leads to
    inconsistent data.
  • [4.4 only] When opening of a new connection fails, the pool used to
    forcefully close all connections to the host, including lent
    connections. Opening the doors wide for race conditions because connections
    are not thread safe.

@robsdedude robsdedude force-pushed the fix-pool-connection-ownership branch from 847a144 to 7d9a95d Compare May 31, 2022 14:20
@robsdedude robsdedude force-pushed the fix-pool-connection-ownership branch from 7d9a95d to bb06487 Compare May 31, 2022 14:26
@robsdedude robsdedude force-pushed the fix-pool-connection-ownership branch 2 times, most recently from 70e899b to 91292a9 Compare May 31, 2022 15:14
Fixes `ValueError: deque.remove(x): x not in deque` when multiple connections
to the same server brake more or less simultaneously.
@robsdedude robsdedude force-pushed the fix-pool-connection-ownership branch from 91292a9 to b695e56 Compare May 31, 2022 15:33
Copy link
Contributor

@AndyHeap-NeoTech AndyHeap-NeoTech left a comment

Choose a reason for hiding this comment

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

Maybe just expand the PR with explanation of the bug it's fixing.

robsdedude added a commit that referenced this pull request Jun 1, 2022
…-4.4

[4.4] Fix pool connection ownership 4.4

Backport or #732

Fixing and testing two faulty corner-cases
 * When a connection fails, all idle connections to that host will be closed.
   If their closure fails, the same action is invoked recursively while being
   in the process of closing idle connections already. This leads to
   inconsistent data.
 * [4.4 only] When opening of a new connection fails, the pool used to
   forcefully close all connections to the host, including lent
   connections. Opening the doors wide for race conditions because connections
   are not thread safe.
@robsdedude robsdedude merged commit 07041fb into neo4j:5.0 Jun 1, 2022
@robsdedude robsdedude deleted the fix-pool-connection-ownership branch June 1, 2022 08:17
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