flowable / flowable/flowable-engine

Frequent Async message Send and Receive bug while use Kafka

Aperta
#2,839 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Java
Stelle
9.5k
Fork
2.9k
Merge medio
7h 8m
PR unite (30g)
2

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia con ExecuteAsyncRunnable#run e lockJob, quindi esamina il percorso catch attraverso unacquireJob, dove l’issue segnala che il messaggio viene inviato nuovamente. Riproduci gli invii e le ricezioni ripetuti con Kafka osservando il lock di esecuzione in act_ru_execution e acquisisci l’eccezione che causa il fallimento di lockJob. Il lavoro è completato quando la causa del fallimento è stata identificata e il ciclo di messaggi ripetuti non porta più la CPU al 100%.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, kafka
Ambito
backend, databases, distributed-systems
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.