** exception translation for pymysql "Lock wait timeout exceeded" broken Edit - Backport request for upstream bug: https://bugs.launchpad.net/oslo.db/+bug/1608691. - There is already a backport for mitaka: https://review.openstack.org/350161. - We would like to have a backport to OSP 8.
the mitaka backport was released in oslo.db 4.7.1: https://review.openstack.org/#/c/352370/ however our own python-oslo-db for rhos-9.0 is still on 4.6.0: http://pkgs.devel.redhat.com/cgit/rpms/python-oslo-db/tree/python-oslo-db.spec?h=rhos-9.0-rhel-7 so this backport should be across both rhos-9.0 and rhos-8.0.
Created attachment 1264761 [details] runs a mysql deadlock through oslo.db here's how to test this: 1. environment has a running MariaDB server, with the usual "root"/ "no password" login (we can add a password to the script if need be) 2. environment has target version of oslo.db installed 3. run script: python oslo_db_deadlock.py output will show a bunch of SQL, then end with a stack trace, at the bottom will be: oslo_db.exception.DBDeadlock: (pymysql.err.InternalError) (1205, u'Lock wait timeout exceeded; try restarting transaction') [SQL: 'select * from x for update'] if the patch *didn't* work, then you will see: oslo_db.exception.DBError: (pymysql.err.InternalError) (1205, u'Lock wait timeout exceeded; try restarting transaction') [SQL: 'select * from x for update']
Verified. [root@controller-0 heat-admin]# rpm -qa |grep python-oslo-db python-oslo-db-2.6.0-5.el7ost.noarch [root@controller-0 heat-admin]# cat /usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/exc_filters.py |sed -n '61p' @filters("mysql", sqla_exc.DatabaseError, [root@controller-0 heat-admin]#
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:1542