fix(app): keep object futures off caller stacks

This commit is contained in:
马登山
2026-08-13 17:55:01 +08:00
parent 2610801136
commit f0fb77f35a
+13 -7
View File
@@ -6544,12 +6544,15 @@ impl DefaultObjectUsecase {
}) })
} }
#[instrument(level = "trace", skip(self, req))] pub fn execute_get_object(
#[hotpath::measure(impl_type = "DefaultObjectUsecase")] &self,
pub async fn execute_get_object(&self, req: S3Request<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> { req: S3Request<GetObjectInput>,
Box::pin(self.execute_get_object_inner(req)).await ) -> impl std::future::Future<Output = S3Result<S3Response<GetObjectOutput>>> + 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<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> { async fn execute_get_object_inner(&self, req: S3Request<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> {
if let Some(context) = &self.context { if let Some(context) = &self.context {
let _ = context.object_store(); let _ = context.object_store();
@@ -7004,11 +7007,14 @@ impl DefaultObjectUsecase {
result result
} }
#[instrument(level = "debug", skip(self, req))] pub fn execute_copy_object(
pub async fn execute_copy_object(&self, req: S3Request<CopyObjectInput>) -> S3Result<S3Response<CopyObjectOutput>> { &self,
Box::pin(self.execute_copy_object_inner(req)).await req: S3Request<CopyObjectInput>,
) -> impl std::future::Future<Output = S3Result<S3Response<CopyObjectOutput>>> + 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<CopyObjectInput>) -> S3Result<S3Response<CopyObjectOutput>> { async fn execute_copy_object_inner(&self, req: S3Request<CopyObjectInput>) -> S3Result<S3Response<CopyObjectOutput>> {
if let Some(context) = &self.context { if let Some(context) = &self.context {
let _ = context.object_store(); let _ = context.object_store();