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

Deadlock while using session pool #1042

Closed
bcarter97 opened this issue Feb 13, 2024 · 1 comment · Fixed by #1065
Closed

Deadlock while using session pool #1042

bcarter97 opened this issue Feb 13, 2024 · 1 comment · Fixed by #1065

Comments

@bcarter97
Copy link
Contributor

I have encountered a deadlock when using the session pool. This happens when I attempt to use multiple sessions from the pool in parallel and the connection to PG fails. I have a minimal example here including logs/fiber dump that shows the waiting fibers in Skunk. If my understanding is correct, reading in parallel should be possible as the pool#use internally uses a semaphore to control permits, but these don’t seem to be being released properly on a connection failure. Could someone please advise if this is an implementation issue, or a bug with the library?

https://github.com/bcarter97/skunk-session-pool-parallel-deadlock

@mpilquist
Copy link
Member

Thanks for reporting with a great reproduction case. I opened a draft PR with a fix but still need to reproduce in a unit test before merging.

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 a pull request may close this issue.

2 participants