From ecdced9ee7104074cb05bd7aac156cafeaf31a69 Mon Sep 17 00:00:00 2001 From: Omar Brikaa Date: Fri, 13 Sep 2024 16:19:09 +0300 Subject: [PATCH] Add SIGKILL signal for output limits and timeout, add status for output limits --- api/src/job.js | 6 ++++-- readme.md | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/src/job.js b/api/src/job.js index e573843..881aa9f 100644 --- a/api/src/job.js +++ b/api/src/job.js @@ -205,6 +205,7 @@ class Job { this.runtime.output_max_size ) { message = 'stderr length exceeded'; + status = 'EL'; this.logger.info(message); try { process.kill(proc.pid, 'SIGABRT'); @@ -229,6 +230,7 @@ class Job { this.runtime.output_max_size ) { message = 'stdout length exceeded'; + status = 'OL'; this.logger.info(message); try { process.kill(proc.pid, 'SIGABRT'); @@ -287,7 +289,7 @@ class Job { message = message || value; break; case 'status': - status = value; + status = status || value; break; case 'time': cpu_time_stat = parse_float(value) * 1000; @@ -310,7 +312,7 @@ class Job { stdout, stderr, code, - signal, + signal: ['TO', 'OL', 'EL'].includes(status) ? 'SIGKILL' : signal, output, memory, message, diff --git a/readme.md b/readme.md index 2c19b5e..f1172d3 100644 --- a/readme.md +++ b/readme.md @@ -283,6 +283,8 @@ It also contains the `code` and `signal` which was returned from each process. I - `RE` for runtime error - `SG` for dying on a signal - `TO` for timeout (either via `timeout` or `cpu_time`) +- `OL` for stdout length exceeded +- `EL` for stderr length exceeded - `XX` for internal error ```json