Skip to content

Commit

Permalink
Remove retry.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Jan 27, 2025
1 parent 68726f0 commit f82aa71
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
3 changes: 1 addition & 2 deletions crates/remote/src/grpc_remote_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use tonic::{
transport::{Channel, Endpoint},
Code,
};
use tower::{limit::ConcurrencyLimit, retry::Retry, timeout::Timeout, ServiceBuilder};
use tower::{limit::ConcurrencyLimit, timeout::Timeout, ServiceBuilder};
use tracing::{debug, error, trace, warn};

type LayeredService = Timeout<ConcurrencyLimit<RequestHeaders<Channel>>>;
Expand All @@ -43,7 +43,6 @@ pub struct GrpcRemoteClient {
impl GrpcRemoteClient {
fn create_clients(&mut self, headers: HeaderMap) {
let service: LayeredService = ServiceBuilder::new()
// .retry()
.timeout(Duration::from_secs(60 * 60))
.concurrency_limit(150)
.layer(RequestHeadersLayer::new(headers))
Expand Down
23 changes: 17 additions & 6 deletions crates/remote/src/grpc_services.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
use http::{header::HeaderMap, Request};
// use std::future::Future;
use std::task::{Context, Poll};
use tower::retry::Policy;
// use tower::retry::Policy;
use tower::{Layer, Service};

// pub struct RetryPolicy<T>(u8);
// TODO: blocked
// https://github.com/hyperium/tonic/issues/733
// https://github.com/tower-rs/tower/pull/790
// https://github.com/tower-rs/tower/issues/682

// impl<T, E> Policy<Request<T>, Response<T>, E> for RetryPolicy<T> {
// type Future = future::Ready<()>;
// pub struct RetryPolicy(u8);

// fn retry(&mut self, req: &mut Req, result: &mut Result<Res, E>) -> Option<Self::Future> {
// impl<T, E> Policy<Request<T>, Response<T>, E> for RetryPolicy {
// // type Future = future::Ready<()>;
// type Future: Future<Output = ()>;

// fn retry(
// &mut self,
// req: &mut Request<T>,
// result: &mut Result<Response<T>, E>,
// ) -> Option<Self::Future> {
// match result {
// Ok(_) => {
// // Treat all `Response`s as success,
Expand All @@ -30,7 +41,7 @@ use tower::{Layer, Service};
// }
// }

// fn clone_request(&mut self, req: &Req) -> Option<Req> {
// fn clone_request(&mut self, req: &Request<T>) -> Option<Request<T>> {
// Some(req.clone())
// }
// }
Expand Down

0 comments on commit f82aa71

Please sign in to comment.