From f0fb77f35aa274deca040d03e56b66a1557abeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E7=99=BB=E5=B1=B1?= Date: Thu, 13 Aug 2026 17:55:01 +0800 Subject: [PATCH] fix(app): keep object futures off caller stacks --- rustfs/src/app/object_usecase.rs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/rustfs/src/app/object_usecase.rs b/rustfs/src/app/object_usecase.rs index 74fd41a18..02e623178 100644 --- a/rustfs/src/app/object_usecase.rs +++ b/rustfs/src/app/object_usecase.rs @@ -6544,12 +6544,15 @@ impl DefaultObjectUsecase { }) } - #[instrument(level = "trace", skip(self, req))] - #[hotpath::measure(impl_type = "DefaultObjectUsecase")] - pub async fn execute_get_object(&self, req: S3Request) -> S3Result> { - Box::pin(self.execute_get_object_inner(req)).await + pub fn execute_get_object( + &self, + req: S3Request, + ) -> impl std::future::Future>> + Send + '_ { + Box::pin(self.execute_get_object_inner(req)) } + #[instrument(name = "DefaultObjectUsecase::execute_get_object", level = "trace", skip(self, req))] + #[hotpath::measure(label = "DefaultObjectUsecase::execute_get_object", impl_type = "DefaultObjectUsecase")] async fn execute_get_object_inner(&self, req: S3Request) -> S3Result> { if let Some(context) = &self.context { let _ = context.object_store(); @@ -7004,11 +7007,14 @@ impl DefaultObjectUsecase { result } - #[instrument(level = "debug", skip(self, req))] - pub async fn execute_copy_object(&self, req: S3Request) -> S3Result> { - Box::pin(self.execute_copy_object_inner(req)).await + pub fn execute_copy_object( + &self, + req: S3Request, + ) -> impl std::future::Future>> + Send + '_ { + Box::pin(self.execute_copy_object_inner(req)) } + #[instrument(name = "DefaultObjectUsecase::execute_copy_object", level = "debug", skip(self, req))] async fn execute_copy_object_inner(&self, req: S3Request) -> S3Result> { if let Some(context) = &self.context { let _ = context.object_store();