Git Product home page Git Product logo

Comments (3)

MaksJS avatar MaksJS commented on July 20, 2024

same issue for me with supervisor -x coffee.cmd app.coffee on windows

from node-supervisor.

iangreenleaf avatar iangreenleaf commented on July 20, 2024

Thanks for the bug report. Unfortunately, I don't have ready access to a Windows environment, so it's hard for me to pinpoint what the problem would be (I tried and failed to duplicate the problem in Linux using a coffee.cmd symlink, so it must be something system-specific).

If you're interested in helping debug this, here's a patch to print out the pid at a couple different points. Those should match from beginning to end of each restart, or else something funny is going on.

diff --git a/lib/supervisor.js b/lib/supervisor.js
index ae69a2d..6c2c795 100644
--- a/lib/supervisor.js
+++ b/lib/supervisor.js
@@ -187,6 +187,7 @@ function startProgram (prog, exec) {
   util.debug("Starting child process with '" + exec + " " + prog.join(" ") + "'");
   crash_queued = false;
   var child = exports.child = spawn(exec, prog);
+  util.debug("Spawned child process: " + child.pid);
   child.stdout.addListener("data", function (chunk) { chunk && util.print(chunk); });
   child.stderr.addListener("data", function (chunk) { chunk && util.debug(chunk); });
   child.addListener("exit", function (code) {
@@ -210,6 +211,7 @@ function crash () {
   setTimeout(function() {
     if (child) {
       util.debug("crashing child");
+      util.debug("Crashing child process: " + child.pid);
       process.kill(child.pid);
     } else {
       util.debug("restarting child");

My other theory is that process.kill isn't working because of some Windows quirk, though a quick Googling didn't turn up anything. Try running this code and see if that leaves a process running:

var pid = require("child_process").spawn("coffee.cmd", "test.coffee").pid;
require("process").kill(pid);

And does this behave any differently?

var p = require("child_process").spawn("coffee.cmd", "test.coffee");
p.kill();

from node-supervisor.

iangreenleaf avatar iangreenleaf commented on July 20, 2024

Closing for inactivity.

from node-supervisor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.