summaryrefslogtreecommitdiffstats
path: root/Doc/library/socketserver.rst
diff options
context:
space:
mode:
authorSenthil Kumaran <senthil@uthcode.com>2011-05-25 16:22:59 (GMT)
committerSenthil Kumaran <senthil@uthcode.com>2011-05-25 16:22:59 (GMT)
commit5e826e8a1b4727f42cbbb4bd279741ed96404809 (patch)
tree6a347009112eeaf17a671dadf602ab0a596cdd0a /Doc/library/socketserver.rst
parentdac9acedfd9930d2368172c2cec13b6077153a70 (diff)
downloadcpython-5e826e8a1b4727f42cbbb4bd279741ed96404809.zip
cpython-5e826e8a1b4727f42cbbb4bd279741ed96404809.tar.gz
cpython-5e826e8a1b4727f42cbbb4bd279741ed96404809.tar.bz2
Fix closes issue #11109 - socketserver.ForkingMixIn leaves zombies, also fails to reap all zombies in one pass.
A new method called service_action is made available in BaseServer, called by serve_forever loop. This useful in cases where Mixins can use it for cleanup action. ForkingMixin class uses service_action to collect the zombie child processes. Initial Patch by Justin Wark.
Diffstat (limited to 'Doc/library/socketserver.rst')
-rw-r--r--Doc/library/socketserver.rst15
1 files changed, 14 insertions, 1 deletions
diff --git a/Doc/library/socketserver.rst b/Doc/library/socketserver.rst
index ed547f5e..a4c9b63 100644
--- a/Doc/library/socketserver.rst
+++ b/Doc/library/socketserver.rst
@@ -153,8 +153,21 @@ Server Objects
.. method:: BaseServer.serve_forever(poll_interval=0.5)
Handle requests until an explicit :meth:`shutdown` request. Polls for
- shutdown every *poll_interval* seconds.
+ shutdown every *poll_interval* seconds. It also calls
+ :meth:`service_actions` which may be used by a subclass or Mixin to provide
+ various cleanup actions. For e.g. ForkingMixin class uses
+ :meth:`service_actions` to cleanup the zombie child processes.
+ .. versionchanged:: 3.3
+ Added service_actions call to the serve_forever method.
+
+
+.. method:: BaseServer.service_actions()
+
+ This is called by the serve_forever loop. This method is can be overridden
+ by Mixin's to add cleanup or service specific actions.
+
+ .. versionadded:: 3.3
.. method:: BaseServer.shutdown()