HomePhabricator

Support "timeout" parameter in older MySQL connections

Description

Support "timeout" parameter in older MySQL connections

Summary:
Ref T6710. We have two connectors: "MySQL" and "MySQLi". The latter one ("i = improved") has had straightforward support for connection timeouts for 15 months, since it just takes a parameter.

The un-improved connector needs to take a more roundabout route.

Also, improve the exception we throw when a client gets an error because they're missing a permission. This arises when you SHOW SLAVE STATUS from a client without permission to do that, for example.

The next change will update Phabricator to use this parameter properly.

Test Plan:
After next change, specified a bad database and forced thee connector to use MySQL. Forced timeout to 1 second. Reloaded page, saw an error in a few seconds instead of a few minutes.

(We are still much slower than we should be about detecting this condition and marking a host as bad, but that will come in the future.)

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T6710

Differential Revision: https://secure.phabricator.com/D15669

Details

Provenance
epriestleyAuthored on Apr 10 2016, 10:52 AM
epriestleyPushed on Apr 10 2016, 7:17 PM
Reviewer
chad
Differential Revision
D15669: Support "timeout" parameter in older MySQL connections
Parents
rPHU1dddbacbb252: Add a read-only flag to database connections
Branches
Unknown
Tags
Unknown
Tasks
T6710: Support "timeout" in vanilla MySQL connections
Build Status
Buildable 11640
Build 14562: Run Core Tests