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

Slick runs out of connections during extensive streaming usage #1492

Closed
onsails opened this issue Apr 26, 2016 · 3 comments
Closed

Slick runs out of connections during extensive streaming usage #1492

onsails opened this issue Apr 26, 2016 · 3 comments
Labels
Milestone

Comments

@onsails
Copy link

onsails commented Apr 26, 2016

I am using akka-persistence-jdbc plugin for Akka Persistence in some parts of application and slick directly in another parts.
After migrating the the hottest parts from direct slick usage to akka-persistence HikariCP started to throw exceptions:

WARN  com.zaxxer.hikari.pool.LeakTask    Connection leak detection triggered for connection org.postgresql.jdbc.PgConnection@3a3c8d5d, stack trace follows
java.lang.Exception: Apparent connection leak detected

That's not a problem of slow SQL queries. Explain analyze shows that PostgreSQL executes them in ~1 millisecond. But connection waits for something and not being released for minutes. Some more details on that are here: akka/akka-persistence-jdbc#44

akka-persistence-jdbc uses streaming for writes and reads, could it be a slick bug or something is wrong in the way akka-persistence-jdbc does such operations?

I am using slick 3.1.1, HikariCP 2.3.7, PostgreSQL 9.4 with max_connections: 120

@onsails
Copy link
Author

onsails commented Apr 26, 2016

I've experimented with numThreads 4, 8, 20 – anyway I end up with busy pool.

@cvogt cvogt added the bug label Apr 26, 2016
@cvogt cvogt added this to the 3.1.x milestone Apr 26, 2016
@onsails onsails closed this as completed Apr 29, 2016
@onsails
Copy link
Author

onsails commented Apr 29, 2016

Problem was not related to streaming usage nor slick itself.

@onsails
Copy link
Author

onsails commented Apr 29, 2016

Or slick's but related to #1274. We fixed our problem by getting rid of transactionally block in problem code part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants