HLS-29: Return relevant exit statuses



Issue Information

Issue Type: New Feature
 
Priority: Major
Status: Open

Reported By:
Ben Tasker
Assigned To:
Ben Tasker
Project: HLS Stream Creator (HLS)
Resolution: Unresolved
Target version: VNEXT,

Created: 2017-10-12 08:55:13
Time Spent Working


Description
From Github #17

I was trying to use this as part of a general video pipeline, but the script doesn't exit with error codes if there are any problems (other than the one check to verify that ffmpeg exists). This makes it hard to know if it succeeded or not.


With the forked processes for multiple bitrates this may be a little tricky to implement. But it might also be that we can switch away from forking the processes (if I can find my notes from previous tinkering to see why I chose not to use it).

In any case, we should at least attempt to return an appropriate exit status on failure.


Issue Links

Github #17
Toggle State Changes

Activity


MISC-34 has just provided a good example of why this is needed.

Due to an NFS fault, mux jobs were running for a while and then FFMPEG segfaulted, leaving an incomplete encode, with no way for the wrapper script to identify it.

I have a PoC of a way to catch unnatural exits from ffmpeg running through some test encodes at the moment.

Because of the difficulty of getting data from a forked process, in the event of a non-zero exit, createStream will write ffmpeg's status code out to an agreed flag file in $TMPDIR.

I don't really like using files for this, it's messy, but is probably the simplest way to implement for now - at least without a substantial refactor.

The main question mark over the PoC really, is whether or not I'm checking for the correct codes, it seems - https://lists.ffmpeg.org/pipermail/ffmpeg-user/2013-July/016245.html - ffmpeg isn't necessarily straight forward in that respect. From my reading, 123 could still represent a valid encode. For now, though, the PoC just checks for a non-zero code.

Repo: HLS-Stream-Creator
Commit: d33618c89cd4c1080198796d714b4609d997738f
Author: B Tasker <github@<Domain Hidden>>

Date: Sun Jul 28 12:12:53 2019 +0100
Commit Message: HLS-29 Add PoC code for catching ffmpeg failures

If ffmpeg exits with a non-zero exit code, a failure file is written to and the mux is aborted. HLS-Stream-Creator will exit with status code 1 in this event



Modified (-)(+)
-------
HLS-Stream-Creator.sh




Webhook User-Agent

GitHub-Hookshot/20c7c42


View Commit


Repo: HLS-Stream-Creator
Commit: 8b7539ba75ae4f13d7402b6b757b475e63eab39a
Author: B Tasker <github@<Domain Hidden>>

Date: Sun Jul 28 12:54:35 2019 +0100
Commit Message: HLS-29 Write parent pid into failfile name

Stops previous failures breaking future jobs if files don't get tidied for some reason



Modified (-)(+)
-------
HLS-Stream-Creator.sh




Webhook User-Agent

GitHub-Hookshot/20c7c42


View Commit

btasker added 'VNEXT' to Fix Version
btasker removed '1.0' from Fix Version