Hi, met strange problem on my Jenkins with Postgre 9.5 running in Docker. Can't reproduce same problem locally using same docker image and same build command.
I run migrations before each testsuite or individual test using
Flyway.
All tests run sequentially. There is no concurrent test execution.
Here are my c3p0 settings:
Code:
properties.put("hibernate.c3p0.min_size", "5")
properties.put("hibernate.c3p0.max_size", "20")
properties.put("hibernate.c3p0.timeout", "1800")
properties.put("hibernate.c3p0.max_statements", "50")
Tests start to fail with exception:
Code:
Unable to obtain Jdbc connection from DataSource (jdbc:postgresql://jenkins-host:34409/postgres) for user 'postgres': FATAL: sorry, too many clients already
I've added some debug stuff to my test suite. Tests failed because max connection limit reached: 100
I've printed out
Code:
select backend_start, xact_start, query_start, waiting, state, query from pg_stat_activity
Code:
2017-09-10 15:08:13.898509│null │2017-09-10 15:08:13.966206│false│idle │SHOW TRANSACTION ISOLATION LEVEL │
├──────────────────────────┼──────────────────────────┼──────────────────────────┼─────┼──────┼─────────────────────────────────────┤
│2017-09-10 15:08:13.898315│null │2017-09-10 15:08:13.966055│false│idle │SHOW TRANSACTION ISOLATION LEVEL │
There are ~90 queries "SHOW TRANSACTION ISOLATION LEVEL"
Found some SO post:
https://stackoverflow.com/questions/351 ... n-postgresWhat should I do next?
Challenge ops with docker/jenkins problem, since problem is not reproducible locally?
Fix config for c3p0?