forked from google/tarpc
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully handle client-side send errors.
Previously, a client channel would immediately disconnect when encountering an error in Transport::try_send. One kind of error that can occur in try_send is message validation, e.g. validating a message is not larger than a configured frame size. The problem with shutting down the client immediately is that debuggability suffers: it can be hard to understand what caused the client to fail. Also, these errors are not always fatal, as with frame size limits, so complete shutdown was extreme. By bubbling up errors, it's now possible for the caller to programmatically handle them. For example, the error could be walked via anyhow::Error: 2023-01-10T02:49:32.528939Z WARN client: the client failed to send the request Caused by: 0: could not write to the transport 1: frame size too big
- Loading branch information
Showing
3 changed files
with
50 additions
and
30 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