0

Related to this question: Remove lock on environment at every transaction end and How does Jetbrains YouTrack server scales over load?

What can be done to implement a way for Xodus Lock Mechanism to work even with non-graceful application shutdown? For instance, if the application process (which opened write access to a Xodus environment) is killed, the lock remains and the new application process cannot write to the database anymore due to the .lck file, so a manual find . -name "xd.lck" -type f -delete needs to be executed to make it work again.

Additionally, this is true also with multi-process servlet containers/servers which spawns multiple processes of the same application. So the question, how can Xodus Locking mechanism play well with these scenarios?

quarks
  • 33,478
  • 73
  • 290
  • 513

1 Answers1

1

The lock is immediately released after "the application process (which opened write access to a Xodus environment) is killed".

Vyacheslav Lukianov
  • 1,913
  • 8
  • 12
  • How do you share an Environment object across different processes btw? – quarks Sep 08 '20 at 16:56
  • This is not the case for Nginx Unit, as soon as you reconfigurate the web application server with the new war with: `curl -X PUT -d@start.json '127.0.0.1:8443/config/'` then this new configured app will get the lock error `nginx.unit.Context.service(Context.java:971) at jetbrains.exodus.log.Log.tryLock(Log.kt:799) at jetbrains.exodus.log.Log.(Log.kt:120)` – quarks Sep 13 '20 at 18:14
  • Here's a gist to explain what I mean: https://gist.github.com/cyberquarks/51ac2a71aafc874459d1fc9fb5137495 – quarks Sep 13 '20 at 18:20
  • Also, I filed and issue related to this, here: https://youtrack.jetbrains.com/issue/XD-815 – quarks Sep 13 '20 at 18:28