[Python-modules-team] Bug#831836: python-django: Add pymysql support

Thomas Goirand zigo at debian.org
Thu Jul 21 08:02:29 UTC 2016


Hi Raphael,

Thanks for putting me in the loop.

Let me explain what happened in the OpenStack world, so you have a
little bit of background here.

OpenStack uses SQLAlechemy and Eventlet. This is the case for most
daemons across all services. The issue is that, using multitask with
Eventlet, Greenthreads + SQLAlechy, python-mysqldb doesn't work well at
all and, if I remember well, with concurrency, some deadlock may happen
(I don't remember the details, so don't take my words, and read the
openstack-dev at lists.openstack.org for more details).

As SQLAlechemy can support any type of driver (ie: python-mysqldb or
python-pymysql), it was decided that we would use pymysql, because it
was super easy to do so: we only needed to use mysql+pymysql:// as DSN
instead of just mysql://.

As a consequence, Ubuntu people want to use pymysql for Django by
default, which isn't surprising. Though this is only a direct
consequence of them, choosing to *not* support (for security update and
such) things that aren't in "main".

This doesn't even impact Horizon (the OpenStack dashboard), which
doesn't even need a database by default: it *can* use a db, but that's
only as a a cache, and the preferred backend for that is Memcache.
Memcache is even what Ubuntu configure by default in Horizon.

IMO, Ubuntu main vs Ubuntu universe is the least of our concerns in
Debian, and shouldn't influence us at all. However, having support for
pymysql by default in Django would be a nice thing, so that users could
choose. FYI, both drivers share the exact same API, so it is fully
transparent, which is why it was so easy for Corey to write that patch.

One patch which we could provide to upstream would be a *fallback* to
pymysql if the mysqldb Python module isn't present. This would, IMO,
make a lot of sense, and probably would be accepted upstream.

In anyway, Raphael, I fully support your opinion that this type of
things should be a decision from upstream *first*. We can of course
attempt to influence this decision, but I don't really like the kind of
patch Ubuntu people added, as it kind of hide things to our users. We
should stay as close as upstream code as possible in this case. So I'd
suggest closing this bug with no further action.

Cheers,

Thomas Goirand (zigo)



More information about the Python-modules-team mailing list