Skip to content

Commit

Permalink
Add SIGKILL signal for output limits and timeout, add status for outp…
Browse files Browse the repository at this point in the history
…ut limits
  • Loading branch information
Brikaa committed Sep 13, 2024
1 parent a99ce9a commit ecdced9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions api/src/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down Expand Up @@ -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;
Expand All @@ -310,7 +312,7 @@ class Job {
stdout,
stderr,
code,
signal,
signal: ['TO', 'OL', 'EL'].includes(status) ? 'SIGKILL' : signal,
output,
memory,
message,
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ecdced9

Please sign in to comment.