forked from linkerd/linkerd2
-
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.
Apply tapping logic only when taps are active (linkerd#142)
Previously, as the proxy processed requests, it would: Obtain the taps mutex ~4x per request to determine whether taps are active. Construct an "event" ~4x per request, regardless of whether any taps were active. Furthermore, this relied on fragile caching logic, where the grpc server manages individual stream states in a Map to determine when all streams have been completed. And, beyond the complexity of caching, this approach makes it difficult to expand Tap functionality (for instance, to support tapping of payloads). This change entirely rewrites the proxy's Tap logic to (1) prevent the need to acquire muteces in the request path, (2) only produce events as needed to satisfy tap requests, and (3) provide clear (private) API boundaries between the Tap server and Stack, completely hiding gRPC details from the tap service. The tap::service module now provides a middleware that is generic over a way to discover Taps; and the tap::grpc module (previously, control::observe), implements a gRPC service that advertises Taps such that their lifetimes are managed properly, leveraging RAII instead of hand-rolled map-based caching. There is one user-facing change: tap stream IDs are now calculated relative to the tap server. The base id is assigned from the count of tap requests that have been made to the proxy; and the stream ID corresponds to an integer on [0, limit).
- Loading branch information
Showing
20 changed files
with
1,701 additions
and
1,609 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
#![allow(dead_code)] | ||
|
||
use futures::Poll; | ||
use std::fmt; | ||
|
||
|
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 |
---|---|---|
@@ -1,9 +1,6 @@ | ||
mod cache; | ||
pub mod destination; | ||
mod observe; | ||
pub mod pb; | ||
mod remote_stream; | ||
mod serve_http; | ||
|
||
pub use self::observe::Observe; | ||
pub use self::serve_http::serve_http; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.