engineer-man / piston

A high performance general purpose code execution engine.
https://emkc.org/run
MIT License
1.9k stars 239 forks source link

Is there a way to know that the submission failed due to Timeout #679

Open gouseferoz opened 2 months ago

gouseferoz commented 2 months ago

I was wondering if there is a way to know that the execution has stopped due to the timeout? I am not sure if it already exists and it would be helpful if we have one.

livinNector commented 2 months ago

The signal field of the response will be SIGKILL if the execution is terminated due to a timeout, otherwise it is null.

smark-1 commented 1 week ago

In the latest version it doesn't appear to be documented but I found that when the run.status = "TO" the execution has been terminated because of timeout and if it is "XX" it is because of exceeding the output limit.

Brikaa commented 1 week ago

According to the documentation of the latest version, XX is used for reporting internal errors so it should not be relied on for determining if the output limits were exceeded. I have made a PR that sets an appropriate status for exceeding the output limits, and also reports SIGKILL when the time-limit or the output limit is exceeded to maintain backward compatibility.