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