# Problem with Lock owner

**URL:** <https://forum.flowable.org/t/problem-with-lock-owner/10388>\
**Category:** Flowable Engine\
**Created:** [March 30, 2023, 10:25pm UTC](https://forum.flowable.org/t/problem-with-lock-owner/10388 "2023-03-30T22:25:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DeysiLopes](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@DeysiLopes](https://forum.flowable.org/u/DeysiLopes)\
**Post date:** [March 30, 2023, 10:25pm UTC](https://forum.flowable.org/t/problem-with-lock-owner/10388/1 "2023-03-30T22:25:39Z")

</div>

Hi everyone, we’re having the same issue as described in the following links about Lock owner:

> [@Lock Owner Issue](https://forum.flowable.org/t/lock-owner-issue/9931):
>
> Hi Colleagues, In our MySQL db we see that all the job requests are going to single lock owner and hence jobs are not moving at all until we set this lock\_owner as NULL and make it available for next job in the pipeline. Kindly help us to get this solved as soon as possible. As of now we are executing the stuck jobs manually. The locks at OS level looks like below. Most of the jobs are captured by single lock\_owner here: 3f372c61-ad0d-4f98-875a-3f2d761b1d62 Regards, Preeti Shirur …

> [@Remove lock owner and lock time in act\_ru\_job](https://forum.flowable.org/t/remove-lock-owner-and-lock-time-in-act-ru-job/5157):
>
> Sometimes when I restart my server where Folwable Engine is running. Jobs get stuck. Meaning though the lock\_exp\_time\_ has passed , the lock never clears. I have checked asyncExecutorResetExpiredJobsInterval this is set to 1 minute(Default). Now I want a way to best way to remove locks for such jobs. Currently I am clearing them manually update act\_ru\_job set lock\_owner\_ = null , lock\_exp\_time\_ = null where lock\_exp\_time\_ \< now()

Please see images

 ![jobExecutor-ui](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/f/ff928bab5c4e7f46d8a6b238a9ed6a4a6e84d710.png)  
 ![jobExecutor-ui2](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/8/874f29989192b5b01dddac09ee78d57617f43ae0.png)

```yml
version: "3"
services:
  flowable-db:
    image: postgres
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_USER: flowable
      POSTGRES_DB: flowable
    ports:
      - 5432:5432
  flowable-ui:
    image: flowable/flowable-ui
    depends_on:
      - flowable-db
    environment:
      SERVER_PORT: 8080
      SPRING_DATASOURCE_DRIVER-CLASS-NAME: org.postgresql.Driver
      SPRING_DATASOURCE_URL: jdbc:postgresql://flowable-db:5432/flowable
      SPRING_DATASOURCE_USERNAME: flowable
      SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
      FLOWABLE_COMMON_APP_IDM-ADMIN_USER: admin
      FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      FLOWABLE_EXPERIMENTAL_DEBUGGER_ENABLED: true
      FLOWABLE_TASK_APP_REST-ENABLED: true
      FLOWABLE_PROCESS_ASYNC_EXECUTOR_ENABLED: true
      FLOWABLE_CMMN_ASYNC_EXECUTOR_ENABLED: true
      FLOWABLE_ASYNC-EXECUTOR-ACTIVATE: true
      LOGGING_LEVEL_ROOT: "ERROR"
      LOGGING_LEVEL_ORG_FLOWABLE: "DEBUG"
    ports:
      - 8080:8080
    extra_hosts:
      - "host.docker.internal:host-gateway"
  flowable-rest:
    image: flowable/flowable-rest
    depends_on:
      - flowable-db
    ports:
      - 8081:8080
    environment:
      JAVA_OPTS: "-Xms512M -Xmx512M -Dflowable.job.executor.async.core.pool.size=10 -Dflowable.job.executor.async.max.pool.size=20 -Dflowable.job.executor.async.queue.size=100 -Dflowable.job.executor.async.keep.alive.seconds=60"
      SPRING_DATASOURCE_DRIVER-CLASS-NAME: org.postgresql.Driver
      SPRING_DATASOURCE_URL: jdbc:postgresql://flowable-db:5432/flowable
      SPRING_DATASOURCE_USERNAME: flowable
      SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
      FLOWABLE_TASK_APP_REST-ENABLED: true
      FLOWABLE_PROCESS_ASYNC_EXECUTOR_ENABLED: true
      FLOWABLE_CMMN_ASYNC_EXECUTOR_ENABLED: true
      FLOWABLE_ASYNC-EXECUTOR-ACTIVATE: true
      FLOWABLE_COMMON_APP_IDM-ADMIN_USER: admin
      FLOWABLE_COMMON_APP_IDM-ADMIN_PASSWORD: ${ADMIN_PASSWORD}
      LOGGING_LEVEL_ROOT: "ERROR"
      LOGGING_LEVEL_ORG_FLOWABLE: "DEBUG"
# entrypoint: ["./wait-for-something.sh", "flowable-db", "5432", "PostgreSQL", "/flowable-entrypoint.sh"]

```

We’re using version 6.8.0

---

<div class="post-metadata">

**Author:** ![joram](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.flowable.org/joram/32/26_2.png) [@joram](https://forum.flowable.org/u/joram)\
**Post date:** [March 31, 2023, 7:02am UTC](https://forum.flowable.org/t/problem-with-lock-owner/10388/2 "2023-03-31T07:02:37Z")

</div>

By default, jobs will be unlocked after 24 hours by the reset expiry thread. You don’t see that happening? Do you see other jobs being executed? What’s the general throughput of jobs in your system?

---

<div class="post-metadata">

**Author:** ![DeysiLopes](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@DeysiLopes](https://forum.flowable.org/u/DeysiLopes)\
**Post date:** [April 3, 2023, 4:08pm UTC](https://forum.flowable.org/t/problem-with-lock-owner/10388/3 "2023-04-03T16:08:54Z")

</div>

Hello Joram, thank you very much for your response.  
Well, the jobs are not resetting after 24 hours, in fact they start accumulating in the same table ACT\_RU\_JOB and then move to ACT\_RU\_TIMER\_JOB, causing the due date to increase or even jobs without a due date. We also noticed that the jobs have the same LOCK\_OWNER, and as we saw that this problem has occurred before, we thought it could be related.  
When we restart the machine, the RU\_JOB is cleared and the environment returns to normal for a while.  
Below is a video to illustrate our situation.  
 ![joram](https://canada1.discourse-cdn.com/flex035/uploads/flowable/original/2X/e/e9145491725412522419144669db9754d8f35598.gif)
