Skip to content

Commit

Permalink
Merge branch 'main' into feat(http)/cookie_jar
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarisW committed Nov 4, 2024
2 parents 3adaace + e9ab2fd commit 5e173f0
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 70 deletions.
2 changes: 1 addition & 1 deletion scripts/clippy-and-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

echo_command() {
echo "Running $@"
echo "$@"

if [ "${GITHUB_ACTIONS:-}" = "true" ] || [ -n "${DEBUG:-}" ]; then
# If we are in GitHub Actions or env `DEBUG` is non-empty,
Expand Down
2 changes: 1 addition & 1 deletion scripts/selftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset
set -o pipefail

echo_and_run() {
echo "Running $@"
echo "$@"

if [ -n "${DEBUG:-}" ]; then
# If env `DEBUG` is non-empty, output all
Expand Down
2 changes: 1 addition & 1 deletion scripts/volo-cli-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ quiet() {
}

echo_command() {
echo "Run \`$@\`"
echo "\`$@\`"

if [ "${GITHUB_ACTIONS:-}" = "true" ] || [ -n "${DEBUG:-}" ]; then
# If we are in GitHub Actions or env `DEBUG` is non-empty,
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/client/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ where

type Error = S::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ClientContext,
async fn call(
&self,
cx: &mut ClientContext,
mut volo_req: Request<T>,
) -> Result<Self::Response, Self::Error> {
let metadata = volo_req.metadata_mut();
Expand Down
10 changes: 5 additions & 5 deletions volo-grpc/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,9 @@ macro_rules! impl_client {
type Response = S::Response;
type Error = S::Error;

async fn call<'s, 'cx>(
&'s $self,
$cx: &'cx mut crate::context::ClientContext,
async fn call(
&$self,
$cx: &mut crate::context::ClientContext,
$req: Req,
) -> Result<Self::Response, Self::Error> {
$e
Expand All @@ -613,9 +613,9 @@ macro_rules! impl_client {
type Response = S::Response;
type Error = S::Error;

async fn call<'cx>(
async fn call(
$self,
$cx: &'cx mut crate::context::ClientContext,
$cx: &mut crate::context::ClientContext,
$req: Req,
) -> Result<Self::Response, Self::Error> {
$e
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/layer/cross_origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ where
type Response = T::Response;
type Error = T::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut Cx,
async fn call(
&self,
cx: &mut Cx,
req: Request<ReqBody>,
) -> Result<Self::Response, Self::Error> {
// split the header and body
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/layer/grpc_timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ where
type Response = S::Response;
type Error = Status;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut Cx,
async fn call(
&self,
cx: &mut Cx,
req: hyper::Request<ReqBody>,
) -> Result<Self::Response, Self::Error> {
// parse the client_timeout
Expand Down
6 changes: 1 addition & 5 deletions volo-grpc/src/layer/loadbalance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ where

type Error = S::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut Cx,
req: Request<T>,
) -> Result<Self::Response, Self::Error> {
async fn call(&self, cx: &mut Cx, req: Request<T>) -> Result<Self::Response, Self::Error> {
let callee = cx.rpc_info().callee();

let mut picker = match &callee.address {
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/layer/user_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ where
type Response = T::Response;
type Error = T::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut Cx,
async fn call(
&self,
cx: &mut Cx,
mut req: Request<ReqBody>,
) -> Result<Self::Response, Self::Error> {
req.headers_mut()
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/server/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ where
type Response = Response<BoxBody>;
type Error = Status;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ServerContext,
async fn call(
&self,
cx: &mut ServerContext,
req: Request<B>,
) -> Result<Self::Response, Self::Error> {
let path = cx.rpc_info.method();
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/server/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ where
type Response = Response<BoxBody>;
type Error = Status;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ServerContext,
async fn call(
&self,
cx: &mut ServerContext,
req: Request<BoxBody>,
) -> Result<Self::Response, Self::Error> {
let (metadata, extensions, body) = req.into_parts();
Expand Down
6 changes: 3 additions & 3 deletions volo-grpc/src/transport/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ where

type Error = Status;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ClientContext,
async fn call(
&self,
cx: &mut ClientContext,
volo_req: Request<T>,
) -> Result<Self::Response, Self::Error> {
let mut http_client = self.http_client.clone();
Expand Down
6 changes: 1 addition & 5 deletions volo-http/src/utils/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ where
type Response = S::Response;
type Error = S::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut Cx,
req: Req,
) -> Result<Self::Response, Self::Error> {
async fn call(&self, cx: &mut Cx, req: Req) -> Result<Self::Response, Self::Error> {
cx.extensions_mut().insert(self.ext.clone());
self.inner.call(cx, req).await
}
Expand Down
6 changes: 1 addition & 5 deletions volo-thrift/src/client/layer/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ where

type Error = S::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ClientContext,
req: Req,
) -> Result<Self::Response, Self::Error> {
async fn call(&self, cx: &mut ClientContext, req: Req) -> Result<Self::Response, Self::Error> {
match cx.rpc_info.config().rpc_timeout() {
Some(duration) => {
let start = std::time::Instant::now();
Expand Down
16 changes: 6 additions & 10 deletions volo-thrift/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,7 @@ where

type Error = ClientError;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ClientContext,
req: Req,
) -> Result<Self::Response, Self::Error> {
async fn call(&self, cx: &mut ClientContext, req: Req) -> Result<Self::Response, Self::Error> {
let msg = ThriftMessage::mk_client_msg(cx, req);
let resp = self.inner.call(cx, msg).await;
if self.read_biz_error {
Expand Down Expand Up @@ -742,9 +738,9 @@ macro_rules! impl_client {
type Response = S::Response;
type Error = S::Error;

async fn call<'s, 'cx>(
&'s $self,
$cx: &'cx mut crate::context::ClientContext,
async fn call(
&$self,
$cx: &mut crate::context::ClientContext,
$req: Req,
) -> Result<Self::Response, Self::Error> {
$e
Expand All @@ -766,9 +762,9 @@ macro_rules! impl_client {
type Response = S::Response;
type Error = S::Error;

async fn call<'cx>(
async fn call(
$self,
$cx: &'cx mut crate::context::ClientContext,
$cx: &mut crate::context::ClientContext,
$req: Req,
) -> Result<Self::Response, Self::Error> {
$e
Expand Down
6 changes: 1 addition & 5 deletions volo-thrift/src/server/layer/biz_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ where
type Error = crate::ServerError;

#[inline]
async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ServerContext,
req: Req,
) -> Result<Self::Response, Self::Error> {
async fn call(&self, cx: &mut ServerContext, req: Req) -> Result<Self::Response, Self::Error> {
let ret = self.inner.call(cx, req).await.map_err(Into::into);
if let Err(ServerError::Biz(err)) = ret.as_ref() {
cx.common_stats.set_biz_error(err.clone());
Expand Down
6 changes: 3 additions & 3 deletions volo-thrift/src/transport/multiplex/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ where

type Error = ClientError;

async fn call<'cx, 's>(
&'s self,
cx: &'cx mut ClientContext,
async fn call(
&self,
cx: &mut ClientContext,
req: ThriftMessage<Req>,
) -> Result<Self::Response, Self::Error> {
let rpc_info = &cx.rpc_info;
Expand Down
6 changes: 3 additions & 3 deletions volo-thrift/src/transport/pingpong/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ where
type Error = crate::ClientError;

#[inline]
async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut ClientContext,
async fn call(
&self,
cx: &mut ClientContext,
req: ThriftMessage<Req>,
) -> Result<Self::Response, Self::Error> {
let rpc_info = &cx.rpc_info;
Expand Down
3 changes: 3 additions & 0 deletions volo/src/hotrestart/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ impl HotRestart {
if *state != HotRestartState::Uninitalized {
return Ok(());
}
if !sock_dir_path.exists() {
std::fs::create_dir_all(sock_dir_path)?;
}
self.listener_num
.store(server_listener_num, Ordering::Relaxed);
self.parent_sock_path
Expand Down
6 changes: 1 addition & 5 deletions volo/src/loadbalance/layer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ where

type Error = S::Error;

async fn call<'s, 'cx>(
&'s self,
cx: &'cx mut Cx,
req: Req,
) -> Result<Self::Response, Self::Error> {
async fn call(&self, cx: &mut Cx, req: Req) -> Result<Self::Response, Self::Error> {
let callee = cx.rpc_info().callee();

let picker = match &callee.address {
Expand Down

0 comments on commit 5e173f0

Please sign in to comment.