flowable / flowable/flowable-engine
Async executor keeps acquiring jobs even after removal
- Dominant language
- Java
- Stars
- 9.5k
- Forks
- 2.9k
- Avg merge
- 7h 8m
- Merged PRs (30d)
- 2
Description
**Describe the bug**
We use flowable in an embedded scenario within a spring boot application. We have a multi-tenant environment where each tenant has its own schema and by rabbit listener we add/delete tenant. The tenant is successfully deleted (please check code below) but then there are logs that keep searching for async jobs to run.
**Expected behavior**
Async jobs stop to run
**Logs**
"exception for engine bpmn during async job acquisition: \\n### Error querying database. Cause: org.postgresql.util.PSQLException: ERROR: relation \\\"act_ru_job\\\" does not exist\\n Position: 30\\n### The error may exist in org/flowable/job/service/db/mapping/entity/Job.xml\\n### The error may involve org.flowable.job.service.impl.persistence.entity.JobEntityImpl.selectJobsToExecute-Inline\\n### The error occurred while setting parameters\\n### SQL: SELECT RES.* from ACT_RU_JOB RES WHERE SCOPE_TYPE_ is null and LOCK_EXP_TIME_ is null order by RES.ID_ asc LIMIT ? OFFSET ?\\n### Cause: org.postgresql.util.PSQLException: ERROR: relation \\\"act_ru_job\\\" does not exist\\n Position:
**Code**
`ExecutorPerTenantAsyncExecutor asyncExecutor =
(ExecutorPerTenantAsyncExecutor) processEngineConfiguration.getAsyncExecutor();
asyncExecutor.removeTenantAsyncExecutor(tenantId);
((TenantAwareDataSource) processEngineConfiguration.getDataSource()).removeDataSource(tenantId);`
**Additional context**
Flowable version: 7.1.0
Database: Postgres
Spring boot app
AWS cluster
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.