-
Notifications
You must be signed in to change notification settings - Fork 142
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
Conversation
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. |
All other open pull requests have similar failures in Travis. I guess there's something unusual but unrelated going on there? |
@rklyne I would second adding a new configurable setting for this |
@nemesisdesign Sorry, I don't follow you. Do you mean a setting in Travis or one in django-hstore for this change? |
Setting added. |
Added CONNECTION_CREATED_SIGNAL_WEAKREF setting #93
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.