[openstack-dev] [all] Replace mysql-python with mysqlclient

Attila Fazekas afazekas at redhat.com
Tue May 12 15:00:43 UTC 2015





----- Original Message -----
> From: "Robert Collins" <robertc at robertcollins.net>
> To: "OpenStack Development Mailing List (not for usage questions)" <openstack-dev at lists.openstack.org>
> Sent: Tuesday, May 12, 2015 3:06:21 AM
> Subject: Re: [openstack-dev] [all] Replace mysql-python with mysqlclient
> 
> On 12 May 2015 at 10:12, Attila Fazekas <afazekas at redhat.com> wrote:
> >
> >
> >
> >
> 
> >> If you can illustrate a test script that demonstrates the actual failing
> >> of OS threads that does not occur greenlets here, that would make it
> >> immediately apparent what it is you're getting at here.
> >>
> >
> > http://www.fpaste.org/220824/raw/
> >
> > I just put together hello word C example and a hello word threading
> > example,
> > and replaced the print with sleep(3).
> >
> > When I use the sleep(3) from python, the 5 thread program runs in ~3
> > second,
> > when I use the sleep(3) from native code, it runs ~15 sec.
> >
> > So yes, it is very likely a GIL lock wait related issue,
> > when the native code is not assisting.
> 
> Your test code isn't releasing the GIL here, and I'd expect C DB
> drivers to be releasing the GIL: you've illustrated how a C extension
> can hold the GIL, but not whether thats happening.

Yes.

And you are right the C driver wrapper releases the GIL at every important 
mysql C driver call. (Py_BEGIN_ALLOW_THREADS)

Good to know :)


> 
> > Do you need a DB example, by using the mysql C driver,
> > and waiting in an actual I/O primitive ?
> 
> waiting in an I/O primitive is fine as long as the GIL has been released.

http://www.fpaste.org/221101/

Actually the eventlet version of the play/test code
is producing the mentioned error:
'Lock wait timeout exceeded; try restarting transaction'.

I have not seen the above issue with the regular python threads.

The driver does not cooperates with the event hub :(


PS.:
The 'Deadlock found when trying to get lock; try restarting transaction'
would be different situation, and it is not related to the eventlet issue.

> 
> -Rob
> 
> 
> --
> Robert Collins <rbtcollins at hp.com>
> Distinguished Technologist
> HP Converged Cloud
> 
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 



More information about the OpenStack-dev mailing list