Skip to content

Commit

Permalink
Version 0.8.40
Browse files Browse the repository at this point in the history
Better support for catching child spawn errors when the PID, STDIN or STDOUT are all undefined.
Presumably this can happen with a server that is completely out of memory.
Apparently Node.js doesn't throw an error for this.  Go figure!
  • Loading branch information
jhuckaby committed Feb 7, 2020
1 parent fad91ad commit 267554d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/job.js
Expand Up @@ -586,12 +586,15 @@ module.exports = Class.create({
// spawn child
try {
child = cp.spawn( child_cmd, child_args, child_opts );
if (!child || !child.pid || !child.stdin || !child.stdout) {
throw new Error("Child process failed to spawn (Server possibly out of memory?)");
}
}
catch (err) {
if (worker.log_fd) { fs.closeSync(worker.log_fd); worker.log_fd = null; }
job.pid = 0;
job.code = 1;
job.description = "Child process error: " + child_cmd + ": " + Tools.getErrorDescription(err);
job.description = "Child spawn error: " + child_cmd + ": " + Tools.getErrorDescription(err);
this.logError("child", job.description);
this.activeJobs[ job.id ] = job;
this.finishLocalJob( job );
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "Cronicle",
"version": "0.8.39",
"version": "0.8.40",
"description": "A simple, distributed task scheduler and runner with a web based UI.",
"author": "Joseph Huckaby <jhuckaby@gmail.com>",
"homepage": "https://github.com/jhuckaby/Cronicle",
Expand Down

0 comments on commit 267554d

Please sign in to comment.