Browse files

Have the WSGI loader call shutdown() on a socket after every request …

…just in case the app spawns a child process that keeps the socket open.
  • Loading branch information...
1 parent fcc3403 commit 05042640512d4b7ca8ccf166a236fb2d77974ebb @FooBarWidget FooBarWidget committed Mar 1, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 helper-scripts/wsgi-loader.py
View
6 helper-scripts/wsgi-loader.py
@@ -124,6 +124,12 @@ def main_loop(self):
logging.exception("WSGI application raised an exception!")
finally:
try:
+ # Shutdown the socket like this just in case the app
+ # spawned a child process that keeps it open.
+ client.shutdown(socket.SHUT_WR)
+ except:
+ pass
+ try:
client.close()
except:
pass

0 comments on commit 0504264

Please sign in to comment.