From c3f426478133ee0c17fe514e4560171b6142cb37 Mon Sep 17 00:00:00 2001 From: Brian Broll Date: Sat, 9 Mar 2019 15:00:33 -0800 Subject: [PATCH] Suppress ESRCH errors when killing job process. Closes #1209 (#1210) --- src/plugins/GenerateJob/templates/start.ejs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/GenerateJob/templates/start.ejs b/src/plugins/GenerateJob/templates/start.ejs index 74ba0c10a..3a58d68fc 100644 --- a/src/plugins/GenerateJob/templates/start.ejs +++ b/src/plugins/GenerateJob/templates/start.ejs @@ -219,7 +219,13 @@ requirejs([ pid = job.pid; job = null; log(`killing process group: ${pid}`); - process.kill(-pid, 'SIGTERM'); + try { + process.kill(-pid, 'SIGTERM'); + } catch (err) { + if (!err.message.includes('ESRCH')) { + log('Error while killing process group: ' + err.message); + } + } } if (exitCode !== undefined) { if (exitCode !== null) {