Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Migrate all services to context based #5677

Open
4 of 31 tasks
Tracked by #5480
Xuanwo opened this issue Mar 1, 2025 · 0 comments
Open
4 of 31 tasks
Tracked by #5480

Migrate all services to context based #5677

Xuanwo opened this issue Mar 1, 2025 · 0 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed rust Pull requests that update Rust code

Comments

@Xuanwo
Copy link
Member

Xuanwo commented Mar 1, 2025

#5480 has implemented everything we need to context API. This issues is used to track the progress of migrating all services to context based.

The migration itself is simple, we just need to use the HttpClient fomr AccessorInfo instead of backend directly, for example:

diff --git a/core/src/services/s3/core.rs b/core/src/services/s3/core.rs
index d4375b520b6..173a33d50ef 100644
--- a/core/src/services/s3/core.rs
+++ b/core/src/services/s3/core.rs
@@ -101,7 +101,6 @@ pub struct S3Core {
     pub signer: AwsV4Signer,
     pub loader: Box<dyn AwsCredentialLoad>,
     pub credential_loaded: AtomicBool,
-    pub client: HttpClient,
     pub checksum_algorithm: Option<ChecksumAlgorithm>,
 }
 
@@ -198,7 +197,7 @@ impl S3Core {
 
     #[inline]
     pub async fn send(&self, req: Request<Buffer>) -> Result<Response<Buffer>> {
-        self.client.send(req).await
+        self.info.http_client().send(req).await
     }
 
     /// # Note
@@ -503,7 +502,7 @@ impl S3Core {
 
         self.sign(&mut req).await?;
 
-        self.client.fetch(req).await
+        self.info.http_client().fetch(req).await
     }
 
     pub fn s3_put_object_request(

The whole change could be seen at #5676

All http based services will need this change.

Services

@Xuanwo Xuanwo added good first issue Good for newcomers help wanted Extra attention is needed rust Pull requests that update Rust code labels Mar 1, 2025
@Xuanwo Xuanwo pinned this issue Mar 3, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed rust Pull requests that update Rust code
Projects
None yet
Development

No branches or pull requests

1 participant