Error while bench frappe --latest

We are getting this trace while updating sites with latest code:

Traceback (innermost last):

  File "/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/notification_count/notification_count.py", line 94, in delete_notification_count_for
    frappe.db.sql("""delete from `tabNotification Count` where for_doctype = %s""", (doctype,))
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 110, in sql
    self._cursor.execute(query, values)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
    self.errorhandler(self, exc, value)
  File "/home/frappe/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
 OperationalError: (1213, 'Deadlock found when trying to get lock; try restarting transaction') 

Anyone’s seen the error before? Any advise? Thanks!

Kill your mysql processes and run again

do show processlist in your mysql console
then kill