Skip to content
Snippets Groups Projects
Commit 92dbe603 authored by huebsch's avatar huebsch
Browse files

concurrently run and consume mediaconch output to prevent deadlocks

Certain constellations of validation profiles and files do lead
to large amounts of validation output being produces by mediaconch.
Outputs > 100 kB have been  observed for some MKA files.

The validation output of the mediaconch Linux process started by the
plugin is fed back to the JVM through a buffered reader, where it is
analyzed and postprocessed by the plugin. While mediaconch executes, the
JVM needs to wait for this process to complete ("p.waitFor()"). In case
the buffer allocated by the buffered reader is too small to hold the
full output of the process, the mediaconch process is sent to sleep by
Linux (interruptible sleep), as it needs to wait for the buffer to be
read by the JVM. On the other end, the Java thread that started the
mediaconch process waits for it to finish, therefore being unable to
read the buffer if the implementation is purely sequential.

This commit introduces a second thread that reads the mediaconch process
output while the mediaconch process is running to avoid the deadlock
situation.
parent 2ad94b66
Branches
Tags v2021.2
No related merge requests found
Checking pipeline status
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment