Comments (5)
@Sbruk from what I can see in the lock it seems like the job cannot get executed because the process instance is exclusively locked:
2024-02-15 08:34:09,588 DEBUG [org.flo.job.ser.imp.cmd.LockExclusiveJobCmd] (flowable-async-job-executor-thread-55) Executing lock exclusive job 97234 97230
2024-02-15 08:34:09,592 DEBUG [org.flo.job.ser.imp.asy.ExecuteAsyncRunnable] (flowable-async-job-executor-thread-55) Could not lock exclusive job. Unlocking job so it can be acquired again. Caught exception: Could not lock process instance
This means that either there are multiple async exclusive jobs for a single process instance or the process instance is locked, but it has never been released.
Locking a job from act_ru_job
is not what is happening.
protected long acquireAndExecuteJobs(CommandExecutor commandExecutor, int remainingCapacity)
this is indeed locking a job for executing it. Then in ExecuteAsyncRunnable#lockJob
the lock is done to do an exclusive lock on the process instance if the job is an exclusive lock.
How many jobs are there for the process instance of the execution with id 97230
?
from flowable-engine.
Hello @filiphr,
Thanks for your prompt answer!
Following the restart, for a given process_instance_id_
there is exactly one entry in act_ru_job
.
Please find below some additional information:
- At the time I stop my application, I have 100+ entries in this table and upon restart, only 8 remain stuck "forever", which is the default value of the executor service's
corePoolSize
if I'm not mistaken. All the other entries are properly executed by flowable. - My serviceTask does not define explicitly the flag
exclusive
and is using a JavaDelegate class for its execution. - In case it helps, here is an extract of the table: act_ru_job.xlsx. The IDs have changed as I re-created my DB compared to my initial set of logs but the issue remains.
Thanks again for your help!
from flowable-engine.
I see that you are using some dummy model. Is this easily reproducible? Can you perhaps create a minimal example that we can run and test?
My serviceTask does not define explicitly the flag
exclusive
and is using a JavaDelegate class for its execution.
The default is that it is exclusive
, so it you do not set it then it is true
. It is an opt-out value. So you need to put exclusive
to be false
for it to be disable.
In any case, can you perhaps also share the act_ru_execution
table. I assume that it would have the lock_time_
and lock_owner_
columns set.
Since you are not using Spring Boot. Are you properly closing the engine when the application shuts down? There is ProcessEngine#close
that would do
if (asyncExecutor != null) {
commandExecutor.execute(new ClearProcessInstanceLockTimesCmd(asyncExecutor.getLockOwner()));
}
that would clear the lock time on the process instances. If you wait for 1 hour those jobs would eventually get executed, 1 hour is the default lock time for the jobs, which is the same time the process instance would get locked.
from flowable-engine.
Indeed, I've missed the lock on the act_ru_execution
table during my test / manual operations. I've done some extra tests this morning following your feedback and it looks all good now. Regarding the shutdown, I'm more interested in the case of an unexpected shutdown so I cannot guarantee the execution of the close method anyway...
Thanks a lot for your help @filiphr !
from flowable-engine.
Glad that it got resolved for you @Sbruk.
Indeed if the application shuts down without going through all the close methods it can be in a state that you are seeing. It will eventually be cleared up, after 1 hour passes. I mentioned the close, because the jobs should have been locked as well (if there was an unexpected shutdown).
from flowable-engine.
Related Issues (20)
- Delay in seconds before script condition executed HOT 6
- task complete before report NoSuchMethodError: org.flowable.bpmn.model.UserTask.getTaskCompleterVariableName() , flowable version: 7.0.1 HOT 2
- Flowable 7.0.1 not getting installed in ecliupse HOT 1
- Conditions should support more than JUEL expressions
- suspendProcessInstanceById question
- BpmnXMLUtil.parseExtensionElement setElementText has bug of Line wrap cover HOT 1
- Process migration cannot migrate processes HOT 1
- Process definition id of an async external worker service task job is not updated after direct migration HOT 2
- 是否有审批人驳回到上级,上级修改后在发起继续审批流程 HOT 1
- Invalid SQL upgrade scripts for HSQL database (7.0.0 -> 7.0.1)
- The DefaultIdentityLinkIterceptor.java creates duplicate identityLinks on ProcessInstance
- AsyncTaskInvokerTaskExecutor supplied by Spring Boot autoconfiguration is not started
- Not possible to exclude the `flowable-event-registry` JAR even if EventRegistry disabled
- startProcessInstanceByKey does not always trigger the process HOT 3
- Liquibase first up does not work with JtaProcessEngineConfiguration HOT 1
- Timer job never unlocked after an exception
- Query the sorting exception of HistoricActivityInstance
- After running runtimeService().deleteProcessInstance(processInstance.getId()) to delete the parent process instance, the CallActivity subprocessInstance query is null HOT 1
- Flowable Open Source Documentation should support dark mode
- 数据量过大以后,flowable有相关的归档功能吗?或者是否支持集成其他分库分表的框架,如 sharding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flowable-engine.