Concurrency issue while submitting the task

Hi

While trying to complete user/service tasks in our bpm, we are getting

{“type”:“RestException”,“message”:“Cannot complete task f34b057f-af91-11ea-be2e-02428e6f8b86: ENGINE-03005 Execution of ‘UPDATE VariableInstanceEntity[e695b1de-af91-11ea-be2e-02428e6f8b86]’ failed. Entity was updated by another transaction concurrently.”}
2020-06-16 05:26:38 INFO java.lang.Class - =======================response end=================================================

Our flows running in production never gave these issues until about a few weeks ago we started getting this across the board. We did upgrade to latest version but still issue persists.

Has something changed resulting in this error?

Why is this happening and how can we fix and prevent this in the future?

Thank you

@PhillanaLeRoux , do you have parallel gateway in your process?

Make sure db isolation is level been set to READ COMMITTED

We are using postgresql for which the read committed is the default setting

do you have parallel gateway in your process?

Yes this seems to happen on one leg of the parallel gateway. I have put Async after on these tasks. It seems like its trying to update the same variable at the same time.
Do you have any other suggestions?

@PhillanaLeRoux, you need to set asyncBefore:true for both the activities after parallel gateway

Oke Thank you. Can you explain to me why this is happening? I just want to form a good understanding so I can avoid this going forward.

@PhillanaLeRoux For service tasks, when it comes to make the decision of choosing the save point between before/after is always should be asyncBefore.

Refer this page for Do Configure a SavePoint Before written as camunda best practices.