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))]
#[hotpath::measure(impl_type = "DefaultObjectUsecase")]
pub async fn execute_get_object(&self, req: S3Request<GetObjectInput>) -> S3Result<S3Response<GetObjectOutput>> {
Box::pin(self.execute_get_object_inner(req)).await
pub fn execute_get_object(
&self,
req: S3Request<GetObjectInput>,
) -> 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>> {
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<CopyObjectInput>) -> S3Result<S3Response<CopyObjectOutput>> {
Box::pin(self.execute_copy_object_inner(req)).await
pub fn execute_copy_object(
&self,
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>> {
if let Some(context) = &self.context {
let _ = context.object_store();