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

Connection leak when using virtual threads. #2268

Open
Jolymmiles opened this issue Dec 3, 2024 · 0 comments
Open

Connection leak when using virtual threads. #2268

Jolymmiles opened this issue Dec 3, 2024 · 0 comments

Comments

@Jolymmiles
Copy link

Jolymmiles commented Dec 3, 2024

I have application with camunda, spring, postgres, kafka.

When i run 1_000_000 tasks i start getting this:

`2024-12-03T14:37:54.698+03:00 WARN 15336 --- [app] [ool housekeeper] com.zaxxer.hikari.pool.ProxyLeakTask : Connection leak detection triggered for org.postgresql.jdbc.PgConnection@18b9822 on thread , stack trace follows

java.lang.Exception: Apparent connection leak detected
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:99) ~[HikariCP-5.1.0.jar:na]
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:269) ~[spring-jdbc-6.1.15.jar:6.1.15]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:532) ~[spring-tx-6.1.15.jar:6.1.15]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:405) ~[spring-tx-6.1.15.jar:6.1.15]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137) ~[spring-tx-6.1.15.jar:6.1.15]
at org.camunda.bpm.engine.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:62) ~[camunda-engine-spring-6-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.interceptor.ProcessApplicationContextInterceptor.execute(ProcessApplicationContextInterceptor.java:70) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.interceptor.CommandCounterInterceptor.execute(CommandCounterInterceptor.java:34) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.interceptor.ExceptionCodeInterceptor.execute(ExceptionCodeInterceptor.java:55) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:57) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:51) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.jobexecutor.ExecuteJobHelper.executeJob(ExecuteJobHelper.java:46) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.engine.impl.ManagementServiceImpl.executeJob(ManagementServiceImpl.java:155) ~[camunda-engine-7.22.0.jar:7.22.0]
at org.camunda.bpm.scenario.impl.JobExecutable.executeJob(JobExecutable.java:31) ~[camunda-bpm-assert-scenario-1.1.1.jar:1.1.1]
at org.camunda.bpm.scenario.impl.JobExecutable.execute(JobExecutable.java:36) ~[camunda-bpm-assert-scenario-1.1.1.jar:1.1.1]
at org.camunda.bpm.scenario.impl.ScenarioImpl.execute(ScenarioImpl.java:52) ~[camunda-bpm-assert-scenario-1.1.1.jar:1.1.1]
at org.camunda.bpm.scenario.impl.ProcessRunnerImpl.execute(ProcessRunnerImpl.java:146) ~[camunda-bpm-assert-scenario-1.1.1.jar:1.1.1]
at ru.vtb.troc.bpmn.payment.scheduler.PaymentSchedulerTest.lambda$paymentSchedulerTest$2(PaymentSchedulerTest.java:72) ~[test-classes/:na]
at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314) ~[na:na]
at java.base/java.lang.VirtualThread.run(VirtualThread.java:329) ~[na:na]
`

Does hikari already have mechanism like semaphore for get connection, and solved problem with destroying virtual threads what can be cause of connection leak?

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