HomePhabricator

Differentiate timeouts from deadlocks

Description

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

Details

Provenance
cburroughsAuthored on
industryPushed on Nov 23 2015, 6:22 PM
Reviewer
Blessed Reviewers
Differential Revision
D10669: Differentiate timeouts from deadlocks
Parents
rPHUe8eaafe04d64: Improve parsing of `use` statements
Branches
Unknown
Tags
Unknown
Build Status
Buildable 9011
Build 10587: Run Core Tests