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

fix paster db clean again #1656

Merged
merged 3 commits into from
May 21, 2014
Merged

fix paster db clean again #1656

merged 3 commits into from
May 21, 2014

Conversation

joetsoi
Copy link
Contributor

@joetsoi joetsoi commented Apr 22, 2014

get_site_user would close the session and dispose of it, then the call to model.User.get() would reopen a new connection and transaction that acquires an exclusive lock on the tables that does not get closed before the the drop tables is run.

This pr fixes it by deferring the commit and remove of get_site_user until after the pylons.c.user_obj is assigned.

I have tested this with the datapusher and harvester and they appear to still work correctly with this patch

User.get() leaves an open transaction when the site user is added to the
pylons context, commit here closes it so it does not lock tables when
running paster db clean
defer commit from get_site_user and attach it to pylons context first
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.61%) when pulling f31a192 on 1656-fix-paster-db-clean into 78b6e6d on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.61%) when pulling f31a192 on 1656-fix-paster-db-clean into 78b6e6d on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.06%) when pulling 7f0e59e on 1656-fix-paster-db-clean into 78b6e6d on master.

@seanh seanh self-assigned this Apr 24, 2014
@seanh seanh merged commit 7f0e59e into master May 21, 2014
@seanh
Copy link
Contributor

seanh commented May 21, 2014

Cheers for this one @joetsoi

@seanh seanh deleted the 1656-fix-paster-db-clean branch May 21, 2014 11:36
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.

3 participants