Differentiate timeouts from deadlocks
Summary:
Currently AphrontDeadlockQueryException is thrown for two different
error codes. Roughly:
- A lock timeout occurred. Maybe your server is a teeny bit slow or you should adjust a config value. It's possible things will deadlock if it keeps going but we don't know.
- Deadklock. Something fundamentally bad has happened or your query is about to lead to a stack overflow session.
Since the resolution in each case is likely different and the raw
error code isn't passed along to tell them apart this is
confusing. Instead this commit creates a new exception for the timeout
case.
Test Plan:
I tried setting innodb_lock_wait_timeout to a variety of
absurdly small values. Nothing broke, but I was unable to induce
a timeout error.
I eventually (hours later) got a deadlock exception and confirmed with
SHOW ENGINE INNODB STATUS; that it really was a deadlock.
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: Korvin, GMTA, epriestley
Differential Revision: https://secure.phabricator.com/D10669