eXist-db / exist

eXist Native XML Database and Application Platform
https://exist-db.org
GNU Lesser General Public License v2.1
429 stars 179 forks source link

[BUG] Document Lock #4867

Open StephanMa opened 1 year ago

StephanMa commented 1 year ago

Describe the bug When working in eXists Apps (Dashboard/eXide) a deadlock occurred frequently as mentioned at the e-editiones meeting.

Expected behavior document lock gets released or error is thrown

To Reproduce It is not reproducible immediately, but working in eXide leads to deadlock quiet often.

Screenshots jstack output is attached

Context (please always complete the following information) One option is to use xst, and copy and paste the output produced by running xst info here:**

Additional context

timeout.log

line-o commented 1 year ago

@StephanMa we experienced a lot of locking issues in version 5.2.0 of eXist-db and I would very strongly recommend to update to a more recent version of eXist-db (5.3.1+ or even better 6.2.0).

StephanMa commented 1 year ago

Ah... this was quick... Alright... will do it immediately... Hopefully without much hassle

line-o commented 1 year ago

@StephanMa can we close this issue?

StephanMa commented 1 year ago

I still get this issues even with the latest release... Will close this with eXist 5.2 and maybe open a new one with latest eXist and a new jstack dump.

line-o commented 1 year ago

Ugh, sad to hear. Then we should keep it open and you can add the jstack here @StephanMa

StephanMa commented 1 year ago

eXist 6.2.0 jstack_2023-05-02.log This time with the right file :)

adamretter commented 1 year ago

The jstack can tell us why a deadlock occurred, but unfortunately it is not enough to tell us where the deadlock occurred. The where is important to understand your specific use-case.

The jstack shows:

  1. Several threads all trying to acquire an INTENTION_READ lock on one or more Collections.
  2. A thread attempting to acquire a WRITE lock on a Binary Document.

When the deadlock occurs, if you dump the Lock Table to a text file and attach it here (along with a fresh jstack), that will enable us to know what is happening.


At a guess - Is it possible that you tried to edit and save changes to a controller.xq(l) file whilst it was in-use by the system. This is known to cause a deadlock, and I believe there is an issue open about this perhaps already (CC @PieterLamers).