Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Validate and specify PoolConnection's behavior in the face of unexpected drops and general panics #122

Closed
abonander opened this issue Mar 6, 2020 · 0 comments

Comments

@abonander
Copy link
Collaborator

Context: #110 (comment)

PoolConnection should probably be sure to clear the inner connection's buffer before releasing it back to the pool, and maybe on panic just kill the connection entirely (because e.g. it could be in an unclosed transaction).

Currently it does... none of that, which is actually a bit concerning (I wrote it so I take full responsibility):

impl<C> Drop for PoolConnection<C>
where
C: Connection + Connect<Connection = C>,
{
fn drop(&mut self) {
if let Some(live) = self.live.take() {
self.pool.release(live.float(&self.pool));
}
}
}

abonander added a commit that referenced this issue Mar 6, 2020
abonander added a commit that referenced this issue Mar 6, 2020
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

No branches or pull requests

1 participant