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

track cloned connections #167

Merged

Conversation

netcriptus
Copy link
Contributor

This solves Issue 166 (with many thanks to @synchrone for debugging it!)

@@ -378,6 +378,11 @@ def append_association_operation(self, conn, table_name, params, op):
uow = self.units_of_work[conn.engine]
uow.pending_statements.append(stmt)

def track_cloned_connections(self, c, opt):
for connection, uow in self.units_of_work.items():
Copy link
Contributor

Choose a reason for hiding this comment

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

if c not in self.units_of_work.keys() perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@synchrone
Copy link
Contributor

Right, now we need to get rid of those pesky clones in uow dict somehow ...

@netcriptus netcriptus force-pushed the hotfix/track-cloned-connections branch from a560867 to f0f6044 Compare August 16, 2017 14:40
@netcriptus
Copy link
Contributor Author

@kvesteri can we have your opinion on this? Looks about ready to me, tests are passing, and solves the issue I opened. It would be great to have this merged to master.

@kvesteri
Copy link
Owner

kvesteri commented Aug 22, 2017

Before merging this PR needs to:

  1. Have at least some unit test that clearly defines the issue
  2. Squash the commits for clearer version history

@netcriptus netcriptus force-pushed the hotfix/track-cloned-connections branch from c2be980 to ae0b16e Compare October 17, 2017 12:35
@okcomp
Copy link

okcomp commented Jan 12, 2018

@kvesteri I had the same issue. Is this ready to be merged into master?

@kvesteri
Copy link
Owner

This PR is missing a unit test. Otherwise this is merge-ready.

@kuldeeprishi
Copy link

+1

@rudaporto
Copy link

This PR is really useful to fix KeyError when trying to find the current "uow".

+1

@kvesteri
Copy link
Owner

@netcriptus can you add a unit test that reproduces the original issue?

Aleksandr Bogdanov and others added 2 commits May 16, 2018 16:47
Hotfix/track cloned connections (#2)

Hotfix/track cloned connections (#3)

change iterations

use only ConnectionFairy as indexes

create new dict entry for clones

create entry using old connection

create entry using session

revert to event listening strategy

remove cloned connections on rollback

treat None case when cleaning connections

Hotfix/track cloned connections (#2)

Hotfix/track cloned connections (#3)

change iterations

use only ConnectionFairy as indexes

create new dict entry for clones

create entry using old connection

create entry using session

revert to event listening strategy

remove cloned connections on rollback

treat None case when cleaning connections
@synchrone synchrone force-pushed the hotfix/track-cloned-connections branch from ae0b16e to acef01b Compare May 16, 2018 14:49
@netcriptus
Copy link
Contributor Author

@kvesteri alright, @synchrone and I added some tests that reproduce the bug if the patch is not there. One of the tests failed on the CI because of a network problem but I don't have permission to re-run it.

Can this be merged now?

@kvesteri kvesteri merged commit 8658a89 into kvesteri:master Jun 3, 2018
@netcriptus netcriptus deleted the hotfix/track-cloned-connections branch June 18, 2018 07:25
cmanallen added a commit to caxiam/sqlalchemy-continuum that referenced this pull request Jun 26, 2018
…cloned-connections"

This reverts commit 8658a89, reversing
changes made to c4aad39.
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.

6 participants