Skip to content

Async executor keeps acquiring jobs even after removal #4021

@despoina-kaz

Description

@despoina-kaz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions