sartography / spiff-arena

SpiffWorkflow is a software development platform for building, running, and monitoring executable diagrams
https://www.spiffworkflow.org/
GNU Lesser General Public License v2.1
72 stars 43 forks source link

Deadlock found when trying to get lock; try restarting transaction #1057

Open dinithihj opened 8 months ago

dinithihj commented 8 months ago

Some instances (so far 1 instance from each environment) were suspended after getting the following error. This occurred in the dev.app, test.app, and test.mod environments.

Image

Process Instances

When checking the events tab, noticed that the error occurred after the "Set Xero Currencies Enum List"

Image

FYI: with_hint(MyModel, 'WITH (nolock)')

madhurrya commented 7 months ago

Noticed the same in test.mod. https://test.mod.spiff.status.im/i/866 image

burnettk commented 7 months ago

Maybe just stop doing the fancy “on duplicate key update” stuff: https://medium.com/@mingwho/mysql-deadlock-caused-by-insert-on-duplicate-key-update-893ef30993a8. We can probably just rescue the duplicate key in code and ignore it, since if it is already written, we’re good (everyone is trying to insert the exact same row in this case, since it is just data and its corresponding hash).

madhurrya commented 7 months ago

Noticing this error time to time

sashayar13 commented 4 months ago

Due to this issue, five process instances were errored in prod yesterday. I was able to restore four of them because they errored at the beginning of the process (no task data was captured), but not the one that errored closer to the end of the process.

dinithihj commented 4 months ago

Noticed deadlock errors in 2 instances on the test.mod(version 64/66) while release testing.

image