Skip to content

fix: change recycle strategy for pooled connections - #60

Draft
aeveris wants to merge 2 commits into
keaz:mainfrom
aeveris:change-pool-conn-recycle-strategy
Draft

fix: change recycle strategy for pooled connections#60
aeveris wants to merge 2 commits into
keaz:mainfrom
aeveris:change-pool-conn-recycle-strategy

Conversation

@aeveris

@aeveris aeveris commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR attempts to reset pooled connections to their initial state when they get recycled by (re)binding with the user and password given in the config.

closes #58

@Iizuki
Iizuki self-requested a review July 11, 2026 11:39
@Iizuki
Iizuki marked this pull request as ready for review July 11, 2026 11:40
@Iizuki
Iizuki marked this pull request as draft July 11, 2026 11:40
Comment thread src/pool.rs
Comment on lines +107 to +118
client
.ldap
.simple_bind(&*self.config.bind_dn, &*self.config.bind_password)
.await
.map_err(|e| Self::Error::Connection("simple bind attempt failed".into(), e))?
.success()
.map_err(|e| Self::Error::Connection("simple bind returned an error".into(), e))?;
if client.ldap.is_closed() {
Err(RecycleError::message("ldap connection is closed"))
} else {
Ok(())
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once #61 is fixed it should be enough to just do the is_closed() check here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done now. Merging/rebasing from main and simplifying this should do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Current connection pool recycling strategy leads to reset connections

2 participants