Compare commits
2 Commits
37e83c9813
...
81e315609d
Author | SHA1 | Date |
---|---|---|
Thomas Hobson | 81e315609d | |
Thomas Hobson | 0ab66f4f5f |
|
@ -120,13 +120,18 @@ class Job {
|
||||||
'--nofile=' + this.runtime.max_open_files,
|
'--nofile=' + this.runtime.max_open_files,
|
||||||
'--fsize=' + this.runtime.max_file_size,
|
'--fsize=' + this.runtime.max_file_size,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const timeout_call = [
|
||||||
|
'timeout', '-s', '9', Math.ceil(timeout / 1000),
|
||||||
|
];
|
||||||
|
|
||||||
if (memory_limit >= 0) {
|
if (memory_limit >= 0) {
|
||||||
prlimit.push('--as=' + memory_limit);
|
prlimit.push('--as=' + memory_limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
const proc_call = [
|
const proc_call = [
|
||||||
'nice',
|
'nice',
|
||||||
|
...timeout_call,
|
||||||
...prlimit,
|
...prlimit,
|
||||||
...nonetwork,
|
...nonetwork,
|
||||||
'bash',
|
'bash',
|
||||||
|
@ -336,14 +341,20 @@ class Job {
|
||||||
const [_, ruid, euid, suid, fuid] = uid_line.split(/\s+/);
|
const [_, ruid, euid, suid, fuid] = uid_line.split(/\s+/);
|
||||||
|
|
||||||
const [_1, state, user_friendly] = state_line.split(/\s+/);
|
const [_1, state, user_friendly] = state_line.split(/\s+/);
|
||||||
|
|
||||||
|
const proc_id_int = parse_int(proc_id);
|
||||||
|
|
||||||
if (state == 'Z')
|
if (state == 'Z'){
|
||||||
// Zombie process, just needs to be waited
|
// Zombie process, just needs to be waited, regardless of the user id
|
||||||
|
if(!to_wait.includes(proc_id_int))
|
||||||
|
to_wait.push(proc_id_int);
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
// We should kill in all other state (Sleep, Stopped & Running)
|
// We should kill in all other state (Sleep, Stopped & Running)
|
||||||
|
|
||||||
if (ruid == this.uid || euid == this.uid)
|
if (ruid == this.uid || euid == this.uid)
|
||||||
return parse_int(proc_id);
|
return proc_id_int;
|
||||||
} catch {
|
} catch {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue