Homec4science

Differentiate timeouts from deadlocks

Authored by cburroughs <chris.burroughs@gmail.com> on Nov 23 2015, 19:22.

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

Committed
cburroughs <autocommitter@example.com>Nov 23 2015, 19:22
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUe8eaafe04d64: Improve parsing of `use` statements
Branches
Unknown
Tags
Unknown

Event Timeline

cburroughs <autocommitter@example.com> committed rPHUa055c511ae3c: Differentiate timeouts from deadlocks (authored by cburroughs <chris.burroughs@gmail.com>).Nov 23 2015, 19:22