Git Product home page Git Product logo

Comments (5)

rwz avatar rwz commented on May 12, 2024

So, when should this happen? Typically we're trying to kill the ember process when you quit the "main" rails process. Apparently Zeus keeps the process running in the background and at_exit hook doesn't fire. I'm not sure how we could detect server running under Zeus and start/kill processes appropriately in this scenario.

from ember-cli-rails.

juliogarciag avatar juliogarciag commented on May 12, 2024

Oh well.. the hook runs. If you set a debugger/binding.pry statement there the hook runs. The problem is that the kill uses a signal 2. I don't know exactly why but a signal 2 is something equivalent to a keyboard interrupt and within zeus, the rails process is not a top process but a child of the zeus process, and when the signal 2 happens (the INT signal) the spawned ember processes keeps running as orphans. The solution that worked is just to kill the process tree of the ember process (the ember process generates a child) instead of sending a signal 2. The code that should change is this method:

def stop
  Process.kill "INT", pid if pid
  @pid = nil
end

to this:

def stop
  # This pkill uses TERM instead of INT and kill the entire tree because ember creates a child process.
  exec("pkill -TERM -P #{pid}")
  @pid = nil
end

The problem is that i'm not sure of the disponibility of pkill in all unix-like environments or how this behaves under windows.

from ember-cli-rails.

rwz avatar rwz commented on May 12, 2024

Why sending TERM instead of INT? How does that makes any difference?

from ember-cli-rails.

rwz avatar rwz commented on May 12, 2024

We're sending this INT to the ember process, and it shouldn't matter whose child this ember process it.

Also, could you check if sending HUP works?

from ember-cli-rails.

rondale-sc avatar rondale-sc commented on May 12, 2024

@juliogarciag ping

from ember-cli-rails.

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.