You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2025/11/25 11:58:44 UTC

[PR] chore: use fastpool as object pool impl [opendal]

tisonkun opened a new pull request, #6820:
URL: https://github.com/apache/opendal/pull/6820

   Simplifiy code a lot.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #6820:
URL: https://github.com/apache/opendal/pull/6820


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #6820:
URL: https://github.com/apache/opendal/pull/6820#discussion_r2559773613


##########
core/src/services/etcd/core.rs:
##########
@@ -77,26 +75,34 @@ impl Debug for EtcdCore {
 }
 
 impl EtcdCore {
-    pub async fn conn(&self) -> Result<PooledConnection<'static, Manager>> {
-        let client = self
-            .client
-            .get_or_try_init(|| async {
-                Pool::builder()
-                    .max_size(64)
-                    .build(Manager {
-                        endpoints: self.endpoints.clone(),
-                        options: self.options.clone(),
-                    })
-                    .await
-            })
-            .await?;
-
-        client.get_owned().await.map_err(|err| match err {
-            RunError::User(err) => err,
-            RunError::TimedOut => {
-                Error::new(ErrorKind::Unexpected, "connection request: timeout").set_temporary()
+    pub fn new(endpoints: Vec<String>, options: ConnectOptions) -> Self {
+        let client = bounded::Pool::new(
+            bounded::PoolConfig::new(64),
+            Manager {
+                endpoints: endpoints.clone(),
+                options: options.clone(),
+            },
+        );
+

Review Comment:
   To add an idle_timeout feature, we may follow-up https://github.com/fast/fastpool/blob/355fb6769c6144220410114de307f5f793b61cb8/examples/postgres/src/main.rs#L40-L59
   
   But let's only add it when it's really needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "TennyZhuang (via GitHub)" <gi...@apache.org>.
TennyZhuang commented on PR #6820:
URL: https://github.com/apache/opendal/pull/6820#issuecomment-3575336608

   Which caused a lot of format changes in doctest?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #6820:
URL: https://github.com/apache/opendal/pull/6820#issuecomment-3575340504

   > Which caused a lot of format changes in doctest?
   
   `cargo +nightly fmt --all` for format imports. We don't run it in CI so several outdated one are affected.
   
   You can exclude 052cb4cca1cf49a0577dcfbba3c641fe6637a704 from changeset.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #6820:
URL: https://github.com/apache/opendal/pull/6820#issuecomment-3575347160

   Unstable format result. Revert the format commit for later dig in.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #6820:
URL: https://github.com/apache/opendal/pull/6820#discussion_r2559737816


##########
core/src/services/memcached/backend.rs:
##########
@@ -85,7 +85,7 @@ impl MemcachedBuilder {
     ///
     /// Will panic if `max_size` is 0.
     #[must_use]
-    pub fn connection_pool_max_size(mut self, max_size: u32) -> Self {
+    pub fn connection_pool_max_size(mut self, max_size: usize) -> Self {

Review Comment:
   This is a breaking change but I think it's OK. Our next version would be thus 0.56.0.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] chore: use fastpool as object pool impl [opendal]

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #6820:
URL: https://github.com/apache/opendal/pull/6820#discussion_r2559743890


##########
core/src/services/redis/config.rs:
##########
@@ -40,7 +40,7 @@ pub struct RedisConfig {
     /// The maximum number of connections allowed.
     ///
     /// default is 10
-    pub connection_pool_max_size: Option<u32>,
+    pub connection_pool_max_size: Option<usize>,

Review Comment:
   Ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@opendal.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org