djangonauts / django-hstore

PostgreSQL HStore support for Django.
http://django-hstore.readthedocs.io/
Other
517 stars 142 forks source link

Fix issue#93 - hstore connection registration bug #128

Closed rklyne closed 9 years ago

rklyne commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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

rklyne commented 9 years ago

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

nemesifier commented 9 years ago

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

rklyne commented 9 years ago

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

nemesifier commented 9 years ago

Like this one here: https://github.com/djangonauts/django-hstore/blob/master/django_hstore/apps.py#L13

landscape-bot commented 9 years ago

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

rklyne commented 9 years ago

Setting added.