Add SIGKILL signal for output limits and timeout, add status for output limits

This commit is contained in:
Omar Brikaa 2024-09-13 16:19:09 +03:00
parent a99ce9ae47
commit ecdced9ee7
2 changed files with 6 additions and 2 deletions

View File

@ -205,6 +205,7 @@ class Job {
this.runtime.output_max_size this.runtime.output_max_size
) { ) {
message = 'stderr length exceeded'; message = 'stderr length exceeded';
status = 'EL';
this.logger.info(message); this.logger.info(message);
try { try {
process.kill(proc.pid, 'SIGABRT'); process.kill(proc.pid, 'SIGABRT');
@ -229,6 +230,7 @@ class Job {
this.runtime.output_max_size this.runtime.output_max_size
) { ) {
message = 'stdout length exceeded'; message = 'stdout length exceeded';
status = 'OL';
this.logger.info(message); this.logger.info(message);
try { try {
process.kill(proc.pid, 'SIGABRT'); process.kill(proc.pid, 'SIGABRT');
@ -287,7 +289,7 @@ class Job {
message = message || value; message = message || value;
break; break;
case 'status': case 'status':
status = value; status = status || value;
break; break;
case 'time': case 'time':
cpu_time_stat = parse_float(value) * 1000; cpu_time_stat = parse_float(value) * 1000;
@ -310,7 +312,7 @@ class Job {
stdout, stdout,
stderr, stderr,
code, code,
signal, signal: ['TO', 'OL', 'EL'].includes(status) ? 'SIGKILL' : signal,
output, output,
memory, memory,
message, message,

View File

@ -283,6 +283,8 @@ It also contains the `code` and `signal` which was returned from each process. I
- `RE` for runtime error - `RE` for runtime error
- `SG` for dying on a signal - `SG` for dying on a signal
- `TO` for timeout (either via `timeout` or `cpu_time`) - `TO` for timeout (either via `timeout` or `cpu_time`)
- `OL` for stdout length exceeded
- `EL` for stderr length exceeded
- `XX` for internal error - `XX` for internal error
```json ```json