Jobs getting Struck and DB seeing Connection "idle in transaction"

Hi , I am using Camunda Spring Boot with PostGres DB.
Application runs for a couple of days properly and suddenly we notice that the workflows slows down and eventually stop working.
When we analyze, we found that in DB connections they are going to “idle in transaction” state for the below Query…

select
*

from
ACT_RE_DECISION_DEF d1
inner join (
select
KEY_,
TENANT_ID_,
max(VERSION_) as MAX_VERSION
from
ACT_RE_DECISION_DEF RES
where
KEY_ = ‘$1’
and (RES.TENANT_ID_ is null
or RES.TENANT_ID_ in ($2) )
group by
TENANT_ID_,
KEY_) d2 on
d1.KEY_ = d2.KEY_
where
d1.VERSION_ = d2.MAX_VERSION
and (d1.TENANT_ID_ = d2.TENANT_ID_
or (d1.TENANT_ID_ is null
and d2.TENANT_ID_ is null))

… In Logs we see connection closed related Hikari errors…

Connection Params::

app:
datasource:
camunda:
minimumIdle: 15
maximumPoolSize: 30
maxLifetime: 100000

Hi @aksanth,

The query seems to locate the latest version of a Process Definition (for a specific Tenant). However, with the data provided, I’m not sure what the problem might be.

Can you provide some more information on:

  1. Camunda version used (e.g. 7.13.0, 7.12.0 etc)
  2. Camunda Spring Boot Starter version used
  3. PostgreSQL and PG JDBV driver versions.

This might indicate a memory leak, so it would be useful if you could provide the steps (or an example project) under which the issue can be reproduced.

Some logs or stacktraces would be helpful as well.

Best,
Nikola

Camunda version - 7.10.4
Spring Boot Starter version - 2.0.3.RELEASE
camunda.springboot.version: 3.2.0
PostgreSQL JDBC Driver - JDBC 4.2 - 42.2.2