-
Notifications
You must be signed in to change notification settings - Fork 630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Foreman doesn't shut down gunicorn #72
Comments
Any idea how to fix this? I'm having the same issue... |
Not quite sure. Here's another session without using foreman:
gunicorn does handle the signal properly. |
Thought it might have to do with subprocessing, I did essentially the same foreman does but in python:
|
It seems that when not using Procfile:
Update It seems that foreman shuts down all the processes correctly when not binding to a specific address/port with Further update Binding not with
|
ok, great! I already figured it had to do something with the subprocesses, thanks for the help! The workaround works like a charm :) |
Rolling into #94 |
I'm still getting issue with subprocesses not being shut down on my Clojure app with a Ctrl+C sent to the Foreman process. Here's the contents of my Procfile: web: lein run -m com.twilio.smsauth.core Running with foreman start, and then Ctrl+C: 18> foreman start
Invalid gemspec in [/Library/Ruby/Gems/1.8/specifications/heroku-2.13.0.gemspec]: invalid date format in specification: "2011-11-10 00:00:00.000000000Z"
15:50:46 web.1 | started with pid 24972
15:50:55 web.1 | 2011-11-18 15:50:55.977:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
15:50:56 web.1 | #<Server Server@7213f866>
15:50:56 web.1 | 2011-11-18 15:50:55.979:INFO::jetty-6.1.25
15:50:56 web.1 | 2011-11-18 15:50:56.004:INFO::Started SocketConnector@0.0.0.0:5000
^CSIGINT received
15:50:59 system | sending SIGTERM to all processes There's still a Java process running: 19> ps aux | grep java
kevin 25012 0.0 0.0 2435120 532 s007 R+ 3:51PM 0:00.00 grep -i --color=auto java
kevin 24996 0.0 3.1 2889504 128604 ?? S 3:50PM 0:16.92 /usr/bin/java -cp /Users/kevin/code/smsauth/test:/Users/kevin/code/smsauth/test-resources:/Users/kevin/code/smsauth/src:/Users/kevin/code/smsauth/classes:/Users/kevin/code/smsauth/resources:/Users/kevin/code/smsauth/lib/clj-base64-0.0.0-20100308.145053-2.jar:/Users/kevin/code/smsauth/lib/clj-http-0.2.1.jar:/Users/kevin/code/smsauth/lib/clojure-1.2.1.jar:/Users/kevin/code/smsauth/lib/clojure-contrib-1.2.0.jar:/Users/kevin/code/smsauth/lib/clout-0.4.1.jar:/Users/kevin/code/smsauth/lib/commons-codec-1.5.jar:/Users/kevin/code/smsauth/lib/commons-fileupload-1.2.1.jar:/Users/kevin/code/smsauth/lib/commons-io-1.4.jar:/Users/kevin/code/smsauth/lib/commons-logging-1.1.1.jar:/Users/kevin/code/smsauth/lib/compojure-0.6.5.jar:/Users/kevin/code/smsauth/lib/core.incubator-0.1.0.jar:/Users/kevin/code/smsauth/lib/hiccup-0.3.6.jar:/Users/kevin/code/smsauth/lib/httpclient-4.1.2.jar:/Users/kevin/code/smsauth/lib/httpcore-4.1.2.jar:/Users/kevin/code/smsauth/lib/inflections-0.4.2-20110104.084027-3.jar:/Users/kevin/code/smsauth/lib/java.jdbc-0.1.1.jar:/Users/kevin/code/smsauth/lib/jbcrypt-0.3m.jar:/Users/kevin/code/smsauth/lib/jetty-6.1.25.jar:/Users/kevin/code/smsauth/lib/jetty-util-6.1.25.jar:/Users/kevin/code/smsauth/lib/libphonenumber-3.9.jar:/Users/kevin/code/smsauth/lib/postgresql-9.1-901.jdbc4.jar:/Users/kevin/code/smsauth/lib/ring-basic-authentication-0.0.1.jar:/Users/kevin/code/smsauth/lib/ring-core-0.3.11.jar:/Users/kevin/code/smsauth/lib/ring-jetty-adapter-1.0.0-RC1.jar:/Users/kevin/code/smsauth/lib/ring-servlet-1.0.0-RC1.jar:/Users/kevin/code/smsauth/lib/sandbar-0.4.0-20110601.165758-5.jar:/Users/kevin/code/smsauth/lib/servlet-api-2.5-20081211.jar:/Users/kevin/code/smsauth/lib/servlet-api-2.5.jar:/Users/kevin/code/smsauth/lib/tools.macro-0.1.0.jar -Dclojure.compile.path=/Users/kevin/code/smsauth/classes -Dsmsauth.version=0.1 -Dclojure.debug=false clojure.main -e (do (try (clojure.core/require (quote com.twilio.smsauth.core)) (catch java.io.FileNotFoundException ___3908__auto__)) nil (do (clojure.core/ns leiningen.util.injected) (defn- compose-hooks [f1 f2] (fn [& args] (apply f2 f1 args))) (defn- join-hooks [original hooks] (reduce compose-hooks original hooks)) (defn- run-hooks [hook original args] (apply (join-hooks original (clojure.core/deref hook)) args)) (defn- prepare-for-hooks [v] (when-not (:robert.hooke/hook (meta (clojure.core/deref v))) (let [hook (atom ())] (alter-var-root v (fn [original] (with-meta (fn [& args] (run-hooks hook original args)) (assoc (meta original) :robert.hooke/hook hook :robert.hooke/original original))))))) (defn- add-unless-present [coll f] (if-not (some #{f} coll) (conj coll f) coll)) (defn add-hook "Add a hook function f to target-var. Hook functions are passed the\n target function and all their arguments and must apply the target to\n the args if they wish to continue execution." [target-var f] (prepare-for-hooks target-var) (swap! (:robert.hooke/hook (meta (clojure.core/deref target-var))) add-unless-present f)) (clojure.core/ns user)) (set! *warn-on-reflection* nil) (try (clojure.core/let [v__3906__auto__ (clojure.core/resolve (quote com.twilio.smsauth.core/-main))] (if (clojure.core/ifn? v__3906__auto__) (v__3906__auto__) (clojure.lang.Reflector/invokeStaticMethod "com.twilio.smsauth.core" "main" (clojure.core/into-array [(clojure.core/into-array java.lang.String (quote nil))])))) (finally (clojure.core/when (clojure.core/and false (clojure.core/not= "1.5" (java.lang.System/getProperty "java.specification.version")) true) (clojure.core/shutdown-agents))))) I tried setting a $PORT in my env, or just letting Foreman choose one, and either one seems to reproduce the error. I am running 0.26.1. I'm on a Mac, running Snow Leopard. Please let me know what I can do to solve this. 20> gem search foreman
*** LOCAL GEMS ***
foreman (0.26.1) |
Procfile:
uname -a
ruby --version
Example session:
The text was updated successfully, but these errors were encountered: