-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-core: in TimeoutFilter, only transform a timeout exception ca…
…used by TimeoutFilter Problem The TimeoutFilter transforms any TimeoutException it encounters into a new exception, regardless of whether the timeout exception was triggered by the TimeoutFilter's timer. As a result, information about the original timeout exception (including the timeout) can be lost because the TimeoutFilter will return a timeout exception with its own timeout. Solution Create an internal exception for the TimeoutFilter to throw and catch on timeout to ensure that the TimeoutFilter only transforms the timeout exception caused by its own timeout. Note: this change uncovered a race condition in the MethodBuilderTest in which the global timeout was being thrown before the first retry had time to hit its per-request timeout. With this change, the test was no longer hitting a retry count of 2. To fix this we can enforce the order of events in the MethodBuilderTest. Result When a timeout exception is thrown from a source other than the TimeoutFilter, that exception will make its way all the way to the user, instead of being transformed into a different and misleading timeout exception in the TimeoutFilter. JIRA Issues: CSL-11340 Differential Revision: https://phabricator.twitter.biz/D814094
- Loading branch information
1 parent
66022a1
commit 6a95f37
Showing
4 changed files
with
58 additions
and
5 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