This repository has been archived by the owner on Oct 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support millisecond timeouts for reads, writes, and connects
Summary: Feature: Millisecond Client Timeouts This diff exposes three new client options: MYSQL_OPT_CONNECT_TIMEOUT_MS MYSQL_OPT_READ_TIMEOUT_MS MYSQL_OPT_WRITE_TIMEOUT_MS Which are similar to the non-_MS options, except the value is, of course, in milliseconds. This diff also changes a number of timeout-related codepaths to use a structure rather than a naked integer. This helps prevent many, many classes of errors that come from accidentally multiplying or dividing by 1000 to convert (or forgetting to), and creates a form of type safety for timeouts. Test Plan: jenkins, mtr Reviewers: pivanof, inaam-rana, darnaut Reviewed By: darnaut CC: jtolmer, MarkCallaghan, flamingcow, jeremycole, andrew-ford, liang.guo.752, chip, atcurtis Differential Revision: https://reviews.facebook.net/D17019
- Loading branch information
1 parent
fb29837
commit c1d98eb
Showing
53 changed files
with
397 additions
and
220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
select "no timeout, should work"; | ||
no timeout, should work | ||
no timeout, should work | ||
select "short timeout, should work", sleep(0.90); | ||
short timeout, should work sleep(0.90) | ||
short timeout, should work 0 | ||
select "long timeout, should fail 1s accuracty", sleep(1.01); | ||
ERROR HY000: Read timeout is reached | ||
select "no timeout, should work"; | ||
no timeout, should work | ||
no timeout, should work | ||
select "short timeout, should work", sleep(0.5); | ||
short timeout, should work sleep(0.5) | ||
short timeout, should work 0 | ||
select "short timeout, over one second, should also work", sleep(1.49); | ||
short timeout, over one second, should also work sleep(1.49) | ||
short timeout, over one second, should also work 0 | ||
select "long timeout, should 1500ms accuracy", sleep(1.51); | ||
ERROR HY000: Read timeout is reached | ||
ERROR HY000: Can't connect to MySQL server on '192.0.2.1' (110) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.