mirror of
https://github.com/engineer-man/piston.git
synced 2025-06-07 18:56:26 +02:00
free zombie processes from proctable
This commit is contained in:
parent
18a44bf146
commit
dd31873700
1 changed files with 5 additions and 1 deletions
|
@ -6,6 +6,7 @@ const config = require('./config');
|
||||||
const globals = require('./globals');
|
const globals = require('./globals');
|
||||||
const fs = require('fs/promises');
|
const fs = require('fs/promises');
|
||||||
const ps_list = require('ps-list');
|
const ps_list = require('ps-list');
|
||||||
|
const wait_pid = require('waitpid');
|
||||||
|
|
||||||
const job_states = {
|
const job_states = {
|
||||||
READY: Symbol('Ready to be primed'),
|
READY: Symbol('Ready to be primed'),
|
||||||
|
@ -190,7 +191,10 @@ class Job {
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
processes.map(
|
processes.map(
|
||||||
proc => process.kill(proc.pid, 'SIGKILL')
|
async proc => {
|
||||||
|
process.kill(proc.pid, 'SIGKILL');
|
||||||
|
wait_pid(proc.pid); //Free zombie state process
|
||||||
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue