forked from google/tarpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up Channel request data more reliably.
When an InFlightRequest is dropped before response completion, request data in the Channel persists until either the request expires or the client cancels the request. In rare cases, requests with very large deadlines could clog up the Channel long after request processing ceases. This commit adds a drop hook to InFlightRequest so that if it is dropped before execution completes, a cancellation message is sent to the Channel so that it can clean up the associated request data. This only works for when using `InFlightRequest::execute` or `Channel::execute`. However, users of raw `Channel` have access to the `RequestCancellation` handle via `Channel::request_cancellation`, so they can implement a similar method if they wish to manually clean up request data. Note that once a Channel's request data is cleaned up, that request can never be responded to, even if a response is produced afterward. Fixes google#314
- Loading branch information
Showing
5 changed files
with
184 additions
and
31 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
Oops, something went wrong.