Issue25

Title Deadlock with Lua scripts
Priority bug Status resolved
Superseder Nosy List admin
Assigned To
Keywords Orthanc Core

Created on 2016-09-19.09:22:14 by admin, last changed by admin.

Messages
msg111 (view) Author: admin Date: 2016-09-19.09:22:14
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2016-09-19.07:22:14]

Joe Mesterhazy has reported a deadlock while anonymizing large studies:
https://groups.google.com/forum/#!topic/orthanc-users/QDBpI2Ptit0

The issue is that the "StableSeries" callback is invoked while the previous "StableStudy" that triggered the anonymization is still running, which causes deadlock as the Lua scripting engine of Orthanc is protected by a mutex.

The fix would consist in introducing a shared message queue (FIFO) to store events and delay their actual processing.

As a temporary workaround, increase the "StableAge" configuration of Orthanc to a higher value (e.g. "180" seconds).
msg112 (view) Author: admin Date: 2016-09-20.09:38:40
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2016-09-20.07:38:40]

Furthermore, add concurrency against callbacks such as "ReceivedInstanceFilter()", "IncomingHttpRequestFilter()" and "IncomingFindRequestFilter()", that should be fast and thus not be blocked by "On*()" events. This would require duplicating the Lua context.

https://orthanc.chu.ulg.ac.be/book/users/lua.html#callbacks-to-react-to-events
msg113 (view) Author: admin Date: 2018-05-22.13:11:56
[BitBucket user: Sébastien Jodogne]
[BitBucket date: 2018-05-22.11:11:56]

fix issue #25

→ https://hg.orthanc-server.com/orthanc/changeset/4ecb79c6e81c
History
Date User Action Args
2026-07-29 15:51:19admincreate