flowable / flowable/flowable-engine

Frequent Async message Send and Receive bug while use Kafka

Open
#2,839 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.5k
Forks
2.9k
Avg merge
7h 8m
Merged PRs (30d)
2

Description

**Describe the bug**
In version 6.4.0, and in version 6.0. because I read the sourcode both of them.
I use kafka as async job Manager(extends AbstractMessageBaseJobManager) and send message to kafka. The consumer consumes the job message and call ExecuteAsyncRunnable's run method to exeucte asyc job.
![image](https://user-images.githubusercontent.com/29472151/109587888-cb12d880-7b42-11eb-9655-5353c069e855.png)
I record the log info while send and receive job message called send and receive log.
Occasionally, very frequently send and receive log happened which caused CPU up to 100%. Only suspend the flow can recover the cpu load.
**Expected behavior**
Only once send and receive of job message.

**Code**
In org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable#run, lockjob() method will be executed.
![image](https://user-images.githubusercontent.com/29472151/109588216-5b511d80-7b43-11eb-9ee4-455ce7b7877f.png)
When lockjob() failed, the bug will be reproduced.
Because in org.flowable.job.service.impl.asyncexecutor.ExecuteAsyncRunnable#lockJob, the catch block whill call unacuqireJob() and this method will resend the job message. Then rotated,circle, repeated send and receive.
![image](https://user-images.githubusercontent.com/29472151/109588387-9a7f6e80-7b43-11eb-91ef-ffc4e02052c7.png)
But I don't know which Exeception is throwed to cause this bug.
One possible reason is repeated consuming of kafka message. once one message consumed two time at one time. one message can lock the Execution Entity in DB using column LOCK_TIME_ in table act_ru_execution. Then the next same message try to lock the same execution ,but it is failed.
![image](https://user-images.githubusercontent.com/29472151/109589545-715fdd80-7b45-11eb-90bc-5e4e15ef87db.png)
**Additional context**
Add the version of Flowable that you are using, the database vendor and if you are using Flowable within Spring Boot, the Flowable Task application etc.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.