Homec4science

Support "timeout" parameter in older MySQL connections

Authored by epriestley <git@epriestley.com> on Apr 10 2016, 12:52.

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

Committed
epriestley <git@epriestley.com>Apr 10 2016, 21:17
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU1dddbacbb252: Add a read-only flag to database connections
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUd22d1ec5e35c: Support "timeout" parameter in older MySQL connections (authored by epriestley <git@epriestley.com>).Apr 10 2016, 21:17