question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is not exiting gracefully

See original GitHub issue

Using compose, after docker-compose up. I ask it to quit,<kbd>ctrl</kbd>+<kbd>C</kbd> when started without detaching, or else docker-compose down. I noticed, that my flask-docker instance always time outs after the 10 seconds.

I believe that could be some issue with the pid-1-zombie-process thing.

Some references:

Can that issue apply here?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
luckydonaldcommented, Oct 19, 2018

👍

1reaction
zirucommented, Apr 27, 2018

It seems I do not have permission to create a PR. Here is the local patch (to let superviord becomes the front process of the container, and thus handle the SIGTERM):

diff --git a/python2.7-alpine3.7/start.sh b/python2.7-alpine3.7/start.sh
index 55099b1..8626c15 100644
--- a/python2.7-alpine3.7/start.sh
+++ b/python2.7-alpine3.7/start.sh
@@ -12,4 +12,4 @@ else
 fi

 # Start Supervisor, with Nginx and uWSGI
-/usr/bin/supervisord
+exec /usr/bin/supervisord
diff --git a/python2.7/start.sh b/python2.7/start.sh
index ed7d19c..87f02ba 100644
--- a/python2.7/start.sh
+++ b/python2.7/start.sh
@@ -7,9 +7,9 @@ echo "Checking for script in $PRE_START_PATH"
 if [ -f $PRE_START_PATH ] ; then
     echo "Running script $PRE_START_PATH"
     source $PRE_START_PATH
-else
+else
     echo "There is no script $PRE_START_PATH"
 fi

 # Start Supervisor, with Nginx and uWSGI
-/usr/bin/supervisord
+exec /usr/bin/supervisord
diff --git a/python3.6-alpine3.7/start.sh b/python3.6-alpine3.7/start.sh
index 55099b1..8626c15 100644
--- a/python3.6-alpine3.7/start.sh
+++ b/python3.6-alpine3.7/start.sh
@@ -12,4 +12,4 @@ else
 fi

 # Start Supervisor, with Nginx and uWSGI
-/usr/bin/supervisord
+exec /usr/bin/supervisord
diff --git a/python3.6/start.sh b/python3.6/start.sh
index ed7d19c..87f02ba 100644
--- a/python3.6/start.sh
+++ b/python3.6/start.sh
@@ -7,9 +7,9 @@ echo "Checking for script in $PRE_START_PATH"
 if [ -f $PRE_START_PATH ] ; then
     echo "Running script $PRE_START_PATH"
     source $PRE_START_PATH
-else
+else
     echo "There is no script $PRE_START_PATH"
 fi

 # Start Supervisor, with Nginx and uWSGI
-/usr/bin/supervisord
+exec /usr/bin/supervisord

Can you please help check?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graceful exit - Wikipedia
A graceful exit (or graceful handling) is a simple programming idiom wherein a program detects a serious error condition and "exits gracefully" in...
Read more >
Why do my threads not exit gracefully? - Stack Overflow
The thread blocks in its event loop (QEventLoop::exec). It waits for a quit() signal it apparently does not receive. The event loop of...
Read more >
Shell script not exiting Gracefully - The UNIX and Linux Forums
Hi we are seeing strange behaviour , when we execute shell script it is successfully executing but it's PID is still hanging when...
Read more >
How to Kill a Python Thread - miguelgrinberg.com
I'm often asked how to kill a background thread, and the answer to this question makes a lot of people unhappy: threads cannot...
Read more >
Exiting gracefully: how to leave a job behind - Nature
She advises being factual, not just relying on hearsay, and to consider putting your perspective in writing. “Note if your concerns were raised ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found