flowable / flowable/flowable-engine

Frequent Async message Send and Receive bug while use Kafka

Offen
#2,839 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Java
Sterne
9.5k
Forks
2.9k
Ø Merge
7 Std. 8 Min.
Gemergte PRs (30 T.)
2

Beschreibung

**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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne mit ExecuteAsyncRunnable#run und lockJob und untersuche dann den catch-Pfad über unacquireJob, bei dem das Issue meldet, dass die Nachricht erneut gesendet wird. Reproduziere das wiederholte Senden und Empfangen mit Kafka, während du die Ausführungssperre in act_ru_execution beobachtest, und erfasse die Exception, die dazu führt, dass lockJob fehlschlägt. Erledigt ist die Aufgabe, wenn die Ursache des Fehlers identifiziert ist und die Schleife mit der wiederholten Nachricht die CPU nicht mehr auf 100 % auslastet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, kafka
Bereich
backend, databases, distributed-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.