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 in application because it fails to close pooled connections #2174

Open
psneha716 opened this issue Feb 19, 2024 · 3 comments

Comments

@psneha716
Copy link

Hi team,
We've been facing the following issue since quite sometime in our application that the number of active connections goes upto 50(max) and the connections are not returned back to the pool. Have enabled ProxyLeak detection which reports leaks for all the active connections and they are released only when the application is restarted/an OOM error happens which forces the application to restart. Any help will be greatly appreciated. Thanks in advance!

Spring data jpa + Hibernate + jdbc
Jdk: 18
DB: Postgresql (42.3.5)
Hikaricp: 4.0.3
Spring boot: v2.7.0

Tried setting spring.jpa.properties.hibernate.connection.release_mode=after_transaction, bit it didn't work.

Logs:

2024-02-18T04:14:33.380+05:30 2024-02-18 04:14:33,379 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@26796fd4 on thread http-nio-8082-exec-60, stack trace follows
2024-02-18T04:14:37.133+05:30 2024-02-18 04:14:37,132 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@27754399 on thread http-nio-8082-exec-15, stack trace follows
2024-02-18T04:14:37.452+05:30 2024-02-18 04:14:37,452 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@258365c on thread http-nio-8082-exec-16, stack trace follows
2024-02-18T04:14:37.576+05:30 2024-02-18 04:14:37,576 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@5c029280 on thread http-nio-8082-exec-20, stack trace follows
2024-02-18T04:14:43.449+05:30 2024-02-18 04:14:43,449 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@1d3f98bb on thread http-nio-8082-exec-48, stack trace follows
2024-02-18T04:14:54.821+05:30 2024-02-18 04:14:54,820 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@10054dc4 on thread http-nio-8082-exec-88, stack trace follows
2024-02-18T04:15:03.496+05:30 2024-02-18 04:15:03,495 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@17699fe on thread http-nio-8082-exec-5, stack trace follows
2024-02-18T04:15:04.856+05:30 2024-02-18 04:15:04,856 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@404b93c5 on thread http-nio-8082-exec-87, stack trace follows
2024-02-18T04:15:07.773+05:30 2024-02-18 04:15:07,773 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@71c1770c on thread http-nio-8082-exec-69, stack trace follows
2024-02-18T04:15:14.907+05:30 2024-02-18 04:15:14,907 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@20646c8a on thread http-nio-8082-exec-11, stack trace follows
2024-02-18T04:15:16.077+05:30 2024-02-18 04:15:16,077 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@3a66ee13 on thread http-nio-8082-exec-46, stack trace follows
2024-02-18T04:15:16.357+05:30 2024-02-18 04:15:16,357 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@4a6abb81 on thread http-nio-8082-exec-23, stack trace follows
2024-02-18T04:15:19.037+05:30 2024-02-18 04:15:19,037 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@7b5be428 on thread http-nio-8082-exec-57, stack trace follows
2024-02-18T04:15:33.617+05:30 2024-02-18 04:15:33,616 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@1b741b67 on thread http-nio-8082-exec-49, stack trace follows
2024-02-18T04:15:34.969+05:30 2024-02-18 04:15:34,968 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@4d7dede8 on thread http-nio-8082-exec-28, stack trace follows
2024-02-18T04:15:35.239+05:30 2024-02-18 04:15:35,238 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@502cfa on thread http-nio-8082-exec-22, stack trace follows
2024-02-18T04:15:37.867+05:30 2024-02-18 04:15:37,867 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@416d26c1 on thread http-nio-8082-exec-59, stack trace follows
2024-02-18T04:15:41.706+05:30 2024-02-18 04:15:41,706 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@7066658b on thread http-nio-8082-exec-53, stack trace follows
2024-02-18T04:15:45.013+05:30 2024-02-18 04:15:45,012 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@2142d98e on thread http-nio-8082-exec-58, stack trace follows
2024-02-18T04:15:45.913+05:30 2024-02-18 04:15:45,913 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@16ea7d13 on thread http-nio-8082-exec-26, stack trace follows
2024-02-18T04:15:47.422+05:30 2024-02-18 04:15:47,422 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@250c046d on thread http-nio-8082-exec-3, stack trace follows
2024-02-18T04:15:49.237+05:30 2024-02-18 04:15:49,236 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@2de5c17f on thread http-nio-8082-exec-76, stack trace follows
2024-02-18T04:15:49.245+05:30 2024-02-18 04:15:49,244 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@53096953 on thread http-nio-8082-exec-34, stack trace follows
2024-02-18T04:15:55.036+05:30 2024-02-18 04:15:55,036 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@29638cfb on thread http-nio-8082-exec-41, stack trace follows
2024-02-18T04:16:05.436+05:30 2024-02-18 04:16:05,436 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@67030077 on thread http-nio-8082-exec-2, stack trace follows
2024-02-18T04:16:06.677+05:30 2024-02-18 04:16:06,676 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@38dc060f on thread http-nio-8082-exec-21, stack trace follows
2024-02-18T04:16:13.709+05:30 2024-02-18 04:16:13,709 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@79e10c34 on thread http-nio-8082-exec-80, stack trace follows
2024-02-18T04:16:15.192+05:30 2024-02-18 04:16:15,192 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@485273c7 on thread http-nio-8082-exec-47, stack trace follows
2024-02-18T04:16:16.789+05:30 2024-02-18 04:16:16,788 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@68646c10 on thread http-nio-8082-exec-66, stack trace follows
2024-02-18T04:16:17.046+05:30 2024-02-18 04:16:17,046 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@2959662b on thread http-nio-8082-exec-65, stack trace follows
2024-02-18T04:16:23.043+05:30 2024-02-18 04:16:23,043 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@18bae918 on thread http-nio-8082-exec-70, stack trace follows
2024-02-18T04:16:23.181+05:30 2024-02-18 04:16:23,181 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@49769964 on thread http-nio-8082-exec-40, stack trace follows
2024-02-18T04:16:23.733+05:30 2024-02-18 04:16:23,733 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@7d99afee on thread http-nio-8082-exec-55, stack trace follows
2024-02-18T04:16:26.415+05:30 2024-02-18 04:16:26,415 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@22f6670e on thread http-nio-8082-exec-33, stack trace follows
2024-02-18T04:16:30.439+05:30 2024-02-18 04:16:30,438 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@63cb6d35 on thread http-nio-8082-exec-10, stack trace follows
2024-02-18T04:16:42.118+05:30 2024-02-18 04:16:42,118 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@52622a86 on thread http-nio-8082-exec-12, stack trace follows
2024-02-18T04:16:44.696+05:30 2024-02-18 04:16:44,696 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@3e4927a on thread http-nio-8082-exec-30, stack trace follows
2024-02-18T04:16:46.919+05:30 2024-02-18 04:16:46,918 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@2dedd88c on thread http-nio-8082-exec-51, stack trace follows
2024-02-18T04:16:48.960+05:30 2024-02-18 04:16:48,959 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@6cd0d2b7 on thread http-nio-8082-exec-56, stack trace follows
2024-02-18T04:16:49.764+05:30 2024-02-18 04:16:49,764 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@6c5f722c on thread http-nio-8082-exec-42, stack trace follows
2024-02-18T04:16:53.386+05:30 2024-02-18 04:16:53,385 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@5d7699b9 on thread http-nio-8082-exec-19, stack trace follows
2024-02-18T04:16:54.913+05:30 2024-02-18 04:16:54,913 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@cff2df8 on thread http-nio-8082-exec-71, stack trace follows
2024-02-18T04:16:56.632+05:30 2024-02-18 04:16:56,632 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@38343d4 on thread http-nio-8082-exec-6, stack trace follows
2024-02-18T04:16:58.044+05:30 2024-02-18 04:16:58,043 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@42be49ef on thread http-nio-8082-exec-29, stack trace follows
2024-02-18T04:16:58.404+05:30 2024-02-18 04:16:58,403 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@2291b6a0 on thread http-nio-8082-exec-72, stack trace follows
2024-02-18T04:16:59.084+05:30 2024-02-18 04:16:59,083 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@73b6ca09 on thread http-nio-8082-exec-83, stack trace follows
2024-02-18T04:16:59.893+05:30 2024-02-18 04:16:59,893 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@1834cdda on thread http-nio-8082-exec-7, stack trace follows
2024-02-18T04:17:00.398+05:30 2024-02-18 04:17:00,398 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@26df6880 on thread http-nio-8082-exec-67, stack trace follows
2024-02-18T04:17:01.548+05:30 2024-02-18 04:17:01,548 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@78db8902 on thread http-nio-8082-exec-81, stack trace follows
2024-02-18T10:13:58.719+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@258365c on thread http-nio-8082-exec-16 was returned to the pool (unleaked)
2024-02-18T10:13:58.719+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@68646c10 on thread http-nio-8082-exec-66 was returned to the pool (unleaked)
2024-02-18T10:13:58.719+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@63cb6d35 on thread http-nio-8082-exec-10 was returned to the pool (unleaked)
2024-02-18T10:13:58.719+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@16ea7d13 on thread http-nio-8082-exec-26 was returned to the pool (unleaked)
2024-02-18T10:13:58.720+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@3a66ee13 on thread http-nio-8082-exec-46 was returned to the pool (unleaked)
2024-02-18T10:13:58.720+05:30 2024-02-18 10:13:58,720 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@2dedd88c on thread http-nio-8082-exec-51 was returned to the pool (unleaked)
2024-02-18T10:13:58.720+05:30 2024-02-18 10:13:58,720 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@73b6ca09 on thread http-nio-8082-exec-83 was returned to the pool (unleaked)
2024-02-18T10:13:58.721+05:30 2024-02-18 10:13:58,720 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@4a6abb81 on thread http-nio-8082-exec-23 was returned to the pool (unleaked)
2024-02-18T10:13:58.721+05:30 2024-02-18 10:13:58,721 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@71c1770c on thread http-nio-8082-exec-69 was returned to the pool (unleaked)
2024-02-18T10:13:58.722+05:30 2024-02-18 10:13:58,722 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@250c046d on thread http-nio-8082-exec-3 was returned to the pool (unleaked)
2024-02-18T10:13:58.723+05:30 2024-02-18 10:13:58,717 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@20646c8a on thread http-nio-8082-exec-11 was returned to the pool (unleaked)
2024-02-18T10:13:58.723+05:30 2024-02-18 10:13:58,717 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@49769964 on thread http-nio-8082-exec-40 was returned to the pool (unleaked)
2024-02-18T10:13:58.723+05:30 2024-02-18 10:13:58,717 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@18bae918 on thread http-nio-8082-exec-70 was returned to the pool (unleaked)
2024-02-18T10:13:58.723+05:30 2024-02-18 10:13:58,717 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@29638cfb on thread http-nio-8082-exec-41 was returned to the pool (unleaked)
2024-02-18T10:13:58.724+05:30 2024-02-18 10:13:58,717 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@22f6670e on thread http-nio-8082-exec-33 was returned to the pool (unleaked)
2024-02-18T10:13:58.724+05:30 2024-02-18 10:13:58,717 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@2de5c17f on thread http-nio-8082-exec-76 was returned to the pool (unleaked)
2024-02-18T10:13:58.724+05:30 2024-02-18 10:13:58,718 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@2959662b on thread http-nio-8082-exec-65 was returned to the pool (unleaked)
2024-02-18T10:13:58.724+05:30 2024-02-18 10:13:58,718 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@6c5f722c on thread http-nio-8082-exec-42 was returned to the pool (unleaked)
2024-02-18T10:13:58.724+05:30 2024-02-18 10:13:58,724 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@1d3f98bb on thread http-nio-8082-exec-48 was returned to the pool (unleaked)
2024-02-18T10:13:58.725+05:30 2024-02-18 10:13:58,718 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@7b5be428 on thread http-nio-8082-exec-57 was returned to the pool (unleaked)
2024-02-18T10:13:58.725+05:30 2024-02-18 10:13:58,718 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@404b93c5 on thread http-nio-8082-exec-87 was returned to the pool (unleaked)
2024-02-18T10:13:58.725+05:30 2024-02-18 10:13:58,718 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@7d99afee on thread http-nio-8082-exec-55 was returned to the pool (unleaked)
2024-02-18T10:13:58.725+05:30 2024-02-18 10:13:58,718 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@78db8902 on thread http-nio-8082-exec-81 was returned to the pool (unleaked)
2024-02-18T10:13:58.726+05:30 2024-02-18 10:13:58,725 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@67030077 on thread http-nio-8082-exec-2 was returned to the pool (unleaked)
2024-02-18T10:13:58.726+05:30 2024-02-18 10:13:58,725 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@38343d4 on thread http-nio-8082-exec-6 was returned to the pool (unleaked)
2024-02-18T10:13:58.726+05:30 2024-02-18 10:13:58,726 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@5c029280 on thread http-nio-8082-exec-20 was returned to the pool (unleaked)
2024-02-18T10:13:58.726+05:30 2024-02-18 10:13:58,726 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@1834cdda on thread http-nio-8082-exec-7 was returned to the pool (unleaked)
2024-02-18T10:13:58.726+05:30 2024-02-18 10:13:58,726 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@1b741b67 on thread http-nio-8082-exec-49 was returned to the pool (unleaked)
2024-02-18T10:13:58.727+05:30 2024-02-18 10:13:58,727 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@7066658b on thread http-nio-8082-exec-53 was returned to the pool (unleaked)
2024-02-18T10:13:58.728+05:30 2024-02-18 10:13:58,727 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@416d26c1 on thread http-nio-8082-exec-59 was returned to the pool (unleaked)
2024-02-18T10:13:58.728+05:30 2024-02-18 10:13:58,728 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@cff2df8 on thread http-nio-8082-exec-71 was returned to the pool (unleaked)
2024-02-18T10:13:58.728+05:30 2024-02-18 10:13:58,728 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@4d7dede8 on thread http-nio-8082-exec-28 was returned to the pool (unleaked)
2024-02-18T10:13:58.728+05:30 2024-02-18 10:13:58,727 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@79e10c34 on thread http-nio-8082-exec-80 was returned to the pool (unleaked)
2024-02-18T10:13:58.728+05:30 2024-02-18 10:13:58,728 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@52622a86 on thread http-nio-8082-exec-12 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,729 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@2142d98e on thread http-nio-8082-exec-58 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@5d7699b9 on thread http-nio-8082-exec-19 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,719 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@3e4927a on thread http-nio-8082-exec-30 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,729 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@2291b6a0 on thread http-nio-8082-exec-72 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,729 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@42be49ef on thread http-nio-8082-exec-29 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,729 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@26df6880 on thread http-nio-8082-exec-67 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,720 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@485273c7 on thread http-nio-8082-exec-47 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,722 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@6cd0d2b7 on thread http-nio-8082-exec-56 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,723 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@38dc060f on thread http-nio-8082-exec-21 was returned to the pool (unleaked)
2024-02-18T10:13:58.729+05:30 2024-02-18 10:13:58,724 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@10054dc4 on thread http-nio-8082-exec-88 was returned to the pool (unleaked)
2024-02-18T10:13:58.730+05:30 2024-02-18 10:13:58,726 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@27754399 on thread http-nio-8082-exec-15 was returned to the pool (unleaked)
2024-02-18T10:13:58.730+05:30 2024-02-18 10:13:58,727 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@53096953 on thread http-nio-8082-exec-34 was returned to the pool (unleaked)
2024-02-18T10:13:58.730+05:30 2024-02-18 10:13:58,727 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@17699fe on thread http-nio-8082-exec-5 was returned to the pool (unleaked)
2024-02-18T10:13:58.730+05:30 2024-02-18 10:13:58,729 | INFO | Logistics | ProxyLeakTask | Previously reported leaked connection org.postgresql.jdbc.PgConnection@502cfa on thread http-nio-8082-exec-22 was returned to the pool (unleaked)

One such connection leak log:

2024-02-18T04:14:33.380+05:30 2024-02-18 04:14:33,379 | WARN | Logistics | ProxyLeakTask | Connection leak detection triggered for org.postgresql.jdbc.PgConnection@26796fd4 on thread http-nio-8082-exec-60, stack trace follows
2024-02-18T04:14:33.380+05:30 java.lang.Exception: Apparent connection leak detected
2024-02-18T04:14:33.380+05:30 at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:128)
2024-02-18T04:14:33.380+05:30 at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
2024-02-18T04:14:33.380+05:30 at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:38)
2024-02-18T04:14:33.380+05:30 at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:108)
2024-02-18T04:14:33.380+05:30 at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:138)
2024-02-18T04:14:33.380+05:30 at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.connection(StatementPreparerImpl.java:50)
2024-02-18T04:14:33.380+05:30 at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:149)
2024-02-18T04:14:33.380+05:30 at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:176)
2024-02-18T04:14:33.380+05:30 at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:151)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:2122)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2059)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:2037)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.doQuery(Loader.java:956)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:357)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.doList(Loader.java:2868)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.doList(Loader.java:2850)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2682)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.Loader.list(Loader.java:2677)
2024-02-18T04:14:33.380+05:30 at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:540)
2024-02-18T04:14:33.380+05:30 at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:400)
2024-02-18T04:14:33.380+05:30 at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:219)
2024-02-18T04:14:33.380+05:30 at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1459)
2024-02-18T04:14:33.380+05:30 at org.hibernate.query.internal.AbstractProducedQuery.doList(AbstractProducedQuery.java:1649)
2024-02-18T04:14:33.380+05:30 at org.hibernate.query.internal.AbstractProducedQuery.list(AbstractProducedQuery.java:1617)
2024-02-18T04:14:33.380+05:30 at org.hibernate.query.internal.AbstractProducedQuery.getSingleResult(AbstractProducedQuery.java:1665)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.jpa.repository.query.JpaQueryExecution$SingleEntityExecution.doExecute(JpaQueryExecution.java:198)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:90)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:156)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:144)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:137)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:121)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:159)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:138)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
2024-02-18T04:14:33.380+05:30 at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
2024-02-18T04:14:33.380+05:30 at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:388)
2024-02-18T04:14:33.380+05:30 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
2024-02-18T04:14:33.380+05:30 at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
2024-02-18T04:14:33.380+05:30 at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:145)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
2024-02-18T04:14:33.380+05:30 at io.opentelemetry.javaagent.instrumentation.spring.data.v1_8.SpringDataInstrumentationModule$RepositoryInterceptor.invoke(SpringDataInstrumentationModule.java:112)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
2024-02-18T04:14:33.380+05:30 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215)
2024-02-18T04:14:33.380+05:30 at jdk.proxy3/jdk.proxy3.$Proxy166.getShipmentByAWB(Unknown Source)
2024-02-18T04:14:33.380+05:30 at com.GrowSimplee.Service.TrackOrderImpl.getTrackingDetails(TrackOrderImpl.java:648)
2024-02-18T04:14:33.380+05:30 at com.GrowSimplee.Service.TrackOrderImpl.getTrackingDetailsByField(TrackOrderImpl.java:965)
2024-02-18T04:14:33.380+05:30 at com.GrowSimplee.Controller.TrackApi.getTrackingDetails(TrackApi.java:267)
2024-02-18T04:14:33.380+05:30 at jdk.internal.reflect.GeneratedMethodAccessor252.invoke(Unknown Source)
2024-02-18T04:14:33.380+05:30 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2024-02-18T04:14:33.380+05:30 at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
2024-02-18T04:14:33.380+05:30 at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
2024-02-18T04:14:33.380+05:30 at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.servlet.v3_1.OpenTelemetryHandlerMappingFilter.doFilter(OpenTelemetryHandlerMappingFilter.java:83)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
2024-02-18T04:14:33.380+05:30 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
2024-02-18T04:14:33.380+05:30 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
2024-02-18T04:14:33.380+05:30 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
2024-02-18T04:14:33.380+05:30 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
2024-02-18T04:14:33.380+05:30 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
2024-02-18T04:14:33.380+05:30 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
2024-02-18T04:14:33.380+05:30 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
2024-02-18T04:14:33.380+05:30 at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
2024-02-18T04:14:33.380+05:30 at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
2024-02-18T04:14:33.380+05:30 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
2024-02-18T04:14:33.380+05:30 at java.base/java.lang.Thread.run(Thread.java:833)
@rajaasthana
Copy link

Hi, were you able to find any solution?

@oucem00decat
Copy link

Hello @psneha716, can you share your Hikari/hibernate/jpa config?

@psneha716
Copy link
Author

Hi @oucem00decat,
Thanks for taking a look at the issue. Below are the config details:

#Hibernate config
spring.jpa.hibernate.ddl-auto=none
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.properties.hibernate.connection.release_mode=after_transaction

#Hikari config
logging.level.com.zaxxer.hikari.HikariConfig=DEBUG
logging.level.com.zaxxer.hikari=TRACE
spring.datasource.hikari.leak-detection-threshold=60000
spring.datasource.hikari.maximum-pool-size=50
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.connection-timeout=30000

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

3 participants