Summary: | Orthanc failed to start when /tmp partition was full | ||
---|---|---|---|
Product: | Orthanc | Reporter: | Sébastien Jodogne <s.jodogne> |
Component: | Orthanc Core | Assignee: | Sébastien Jodogne <s.jodogne> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | --- | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All |
Description
Sébastien Jodogne
2020-06-29 15:15:12 CEST
[BitBucket user: Alain Mazy] [BitBucket date: 2019-01-31.11:16:50] @sjodogne unless you've a clear idea of the problem and know how to solve it, I can try to make a setup to reproduce it. Let's talk about it tomorrow. [BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-31.11:37:52] If Orthanc didn't stop cleanly, it can't remove its temporary files (I have just validated that the integration tests don't let any temporary file if Orthanc is stopped in a clean way). On the other hand, it would be a very bad idea to do an automatic cleanup of files in `/tmp` at the Orthanc startup, as this might remove files that are still in use (e.g. if two instances of Orthanc are running on the computer). I think the only possibility is indeed to add a `TemporaryDirectory` configuration option that would defaults to `boost::filesystem::temp_directory_path()` (e.g. `/tmp/` on UNIX-like systems). System administrators would have the responsibility of removing the content of this folder as the first step of their script that launches the Orthanc service. The relevant file in Orthanc is: https://hg.orthanc-server.com/orthanc/file/default/Core/TemporaryFile.cpp Note that *"maybe that is what Orthanc was trying to do at startup"* is a wrong assumption: Orthanc only removes the temporary files it has created during its own execution. Regarding what Orthanc was trying to created in `/tmp/` at the startup, I have absolutely no idea. It might indeed be interested to check this, by combining this new `TemporaryDirectory` option with the `tmpfs` setup described in issue #103. [BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-31.13:00:06] Just discovered the culprit. During the startup of Orthanc, if built with "-DSTANDALONE_BUILD=ON", Orthanc creates a temporary file that contains the DICOM dictionary. This is because DCMTK 3.6.2 does not provide a primitive to read the dictionary from a memory buffer. Check out function "LoadEmbeddedDictionary()" in "FromDcmtkBridge.cpp": https://hg.orthanc-server.com/orthanc/file/Orthanc-1.5.3/Core/DicomParsing/FromDcmtkBridge.cpp#L113 That being said, this file is small and immediately removed, so it makes perfect sense to store it into system-wide `/tmp/` folder. The folder `TemporaryDirectory` should only be used for large temporary files. [BitBucket user: Sébastien Jodogne] [BitBucket date: 2019-01-31.14:33:33] Fix issue #130 (Orthanc failed to start when /tmp partition was full) → https://hg.orthanc-server.com/orthanc/changeset/6fd38327e777 |