Skip to content

[4.4] Fix pool connection ownership 4.4 #733

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

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.

Especially in concurrent environments, this could lead to all sorts of
unspecific errors.
Fixes `ValueError: deque.remove(x): x not in deque` when multiple connections
to the same server brake more or less simultaneously.
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 robsdedude merged commit c9f5709 into neo4j:4.4 Jun 1, 2022
@robsdedude robsdedude deleted the fix-pool-connection-ownership-4.4 branch June 1, 2022 08:17
@robsdedude robsdedude mentioned this pull request Jun 2, 2022
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