-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finagle-core: Be Defensive when Converting Streams to Strings
Problem `RetryPolicy` converts a `Stream[Duration]` to a `String` in order to have nice output for the representation of a `RetryPolicy`. Unfortunately, we've run into instances where calling `toString` on a `Stream` throws an `UnsupportedOperationException`. Given the stack trace, this appears to be a Scala bug, and so we need to work around it. Solution Let's be defensive when calling `toString` on a `Stream[Duration]` inside of `RetryPolicy`. By wrapping the call in a 'try/catch', we can return a non-informative default value which only loses a little bit of information. JIRA Issues: CSL-10396 Differential Revision: https://phabricator.twitter.biz/D582199
- Loading branch information
1 parent
c0f55b0
commit e7ec247
Showing
2 changed files
with
24 additions
and
1 deletion.
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