diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2018-06-28 19:25:00 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2018-06-28 19:25:00 +0200 |
| commit | 03cb68127c7d52642b164a845989f82ab037de7c (patch) | |
| tree | 64d1a0467d638075bb564ea370f2155724b84ab6 | |
| parent | cc447acb4b2724f9850ab15973e39d1c219425e9 (diff) | |
runner
| -rw-r--r-- | app/relay/runner.js | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/relay/runner.js b/app/relay/runner.js index e0e1a29..c7c3166 100644 --- a/app/relay/runner.js +++ b/app/relay/runner.js @@ -51,10 +51,12 @@ function serialize_task(t){ function clear_task(is_gpu, task){ if (is_gpu) { if (state.current_gpu_task.task && state.current_gpu_task.task.uuid === task.uuid) { + state.current_gpu_task.processor = null state.current_gpu_task = idle_state } } else { if (state.current_cpu_task.task && state.current_cpu_task.task.uuid === task.uuid) { + state.current_gpu_task.processor = null state.current_cpu_task = idle_state } } @@ -459,14 +461,23 @@ export function terminate(processor, sigkill=false){ console.log('kill pid', processor.subprocess.pid) processor.task.cancelled = true if (sigkill) { - kill(processor.subprocess.pid, 'SIGKILL') + kill(processor.subprocess.pid, 'SIGKILL', err => { + if (err) { + console.error(err) + } + else { + console.log('process killed via SIGKILL -', processor.subprocess) + processor.subprocess = null + } + }) } else { kill(processor.subprocess.pid, 'SIGTERM', err => { if (err) { console.log(err) } else { - console.log('process killed?', processor.subprocess) + console.log('process killed via SIGTERM -', processor.subprocess) + processor.subprocess = null } }) } |
