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 issue#93 - hstore connection registration bug #128

Merged
merged 2 commits into from Nov 3, 2015

Conversation

rklyne
Copy link
Contributor

@rklyne rklyne commented Jul 28, 2015

This should address issue #93.
I've found the problem and solution. My reproduction was different though.
Django signals are used to observe every new connection and call psycopg2's register_hstore function on it.
Django signals will, by default, store references to the receiver functions as weakrefs.
In a low memory situation these can go away and future connections are not registered to use hstore features.
The fix is very simple - pass weak=False when connecting the signal.

@rklyne
Copy link
Contributor Author

rklyne commented Jul 28, 2015

I will need help explaining why that travis build failed, only for django 1.8.2 and python 3.3. Doesn't seem right to me but I can't kick off another build to check.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 46a740f on rklyne:master into 3b235cb on djangonauts:master.

@rklyne
Copy link
Contributor Author

rklyne commented Jul 29, 2015

All other open pull requests have similar failures in Travis. I guess there's something unusual but unrelated going on there?

@nemesifier
Copy link
Member

@rklyne I would second adding a new configurable setting for this

@rklyne
Copy link
Contributor Author

rklyne commented Oct 22, 2015

@nemesisdesign Sorry, I don't follow you. Do you mean a setting in Travis or one in django-hstore for this change?

@nemesifier
Copy link
Member

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling e362b34 on rklyne:master into 3b235cb on djangonauts:master.

@rklyne
Copy link
Contributor Author

rklyne commented Oct 29, 2015

Setting added.

@nemesifier nemesifier added this to the 1.4.1 milestone Nov 3, 2015
nemesifier added a commit that referenced this pull request Nov 3, 2015
Added CONNECTION_CREATED_SIGNAL_WEAKREF setting #93
@nemesifier nemesifier merged commit b69d559 into djangonauts:master Nov 3, 2015
@prokaktus prokaktus mentioned this pull request Feb 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants