change job decoder error handling so errors reflect in metrics

This commit is contained in:
Jakob Ketterl 2020-12-08 00:28:34 +01:00
parent 519155a12f
commit efac5b0449

View File

@ -194,10 +194,11 @@ class AudioWriter(object):
try: try:
rc = decoder.wait(timeout=10) rc = decoder.wait(timeout=10)
if rc != 0: if rc != 0:
logger.warning("decoder return code: %i", rc) raise RuntimeError("decoder return code: {0}".format(rc))
except subprocess.TimeoutExpired: except subprocess.TimeoutExpired:
logger.warning("subprocess (pid=%i}) did not terminate correctly; sending kill signal.", decoder.pid) logger.warning("subprocess (pid=%i}) did not terminate correctly; sending kill signal.", decoder.pid)
decoder.kill() decoder.kill()
raise
def start(self): def start(self):
(self.wavefilename, self.wavefile) = self.getWaveFile() (self.wavefilename, self.wavefile) = self.getWaveFile()