exist icon indicating copy to clipboard operation
exist copied to clipboard

[BUG] Document Lock

Open StephanMa opened this issue 2 years ago • 7 comments

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

  • Build: eXist-Version 5.2.0
  • Java: 11.0.18 Debian OpenJDK 64bit
  • OS: Linux 5.10.0-21-amd64

Additional context

  • How is eXist-db installed? Download zip and started via startup.sh
  • Any custom changes in e.g. conf.xml? Just changed jetty Port

timeout.log

StephanMa avatar Apr 12 '23 09:04 StephanMa

@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).

line-o avatar Apr 12 '23 10:04 line-o

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

StephanMa avatar Apr 12 '23 10:04 StephanMa

@StephanMa can we close this issue?

line-o avatar Apr 14 '23 11:04 line-o

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.

StephanMa avatar Apr 14 '23 11:04 StephanMa

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

line-o avatar Apr 14 '23 11:04 line-o

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

StephanMa avatar May 02 '23 09:05 StephanMa

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

adamretter avatar May 03 '23 08:05 adamretter