]> granicus.if.org Git - python/commitdiff
Issue #7978: socketserver now restarts the select() call when EINTR is returned.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Apr 2012 22:49:17 +0000 (00:49 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 8 Apr 2012 22:49:17 +0000 (00:49 +0200)
This avoids crashing the server loop when a signal is received.
Patch by Jerzy Kozera.

1  2 
Lib/socketserver.py
Misc/ACKS
Misc/NEWS

index a487e6376126eb4f202127a5b9a6f4c746b582ef,c8a8db1950eee26043445438e7dec8678a382bb6..261e28e6415e5194cd10a7a02eeeb2674af39f22
@@@ -223,11 -232,10 +233,12 @@@ class BaseServer
                  # connecting to the socket to wake this up instead of
                  # polling. Polling reduces our responsiveness to a
                  # shutdown request and wastes cpu at all other times.
-                 r, w, e = select.select([self], [], [], poll_interval)
+                 r, w, e = _eintr_retry(select.select, [self], [], [],
+                                        poll_interval)
                  if self in r:
                      self._handle_request_noblock()
 +
 +                self.service_actions()
          finally:
              self.__shutdown_request = False
              self.__is_shut_down.set()
diff --cc Misc/ACKS
index 800e88435d3dbb1a73d160d5a9c9514fb848f589,3693c1c575055cbedc98768e29cdaddd1f542752..cab01d423d673182b9da6f7e80e81d419ab97525
+++ b/Misc/ACKS
@@@ -554,11 -508,9 +554,12 @@@ Jeff Knup
  Greg Kochanski
  Damon Kohler
  Marko Kohtala
 +Jacek Konieczny
 +Марк Коренберг
 +Arkady Koplyarov
  Vlad Korolev
  Joseph Koshy
+ Jerzy Kozera
  Maksim Kozyarchuk
  Stefan Krah
  Bob Kras
diff --cc Misc/NEWS
index af1b5d0b1e39e244c55d060acae93464bbb727d9,924c7dcb930dfc5aa173a53cbceb31a56ac87e8a..6256e02575e7cef5b2e872aa9c6aac21b7bc87e3
+++ b/Misc/NEWS
@@@ -16,46 -16,6 +16,50 @@@ Core and Builtin
  - Issue #13019: Fix potential reference leaks in bytearray.extend().  Patch
    by Suman Saha.
  
 +Library
 +-------
 +
++- Issue #7978: socketserver now restarts the select() call when EINTR is
++  returned.  This avoids crashing the server loop when a signal is received.
++  Patch by Jerzy Kozera.
++
 +- Issue #14522: Avoid duplicating socket handles in multiprocessing.connection.
 +  Patch by sbt.
 +
 +- Don't Py_DECREF NULL variable in io.IncrementalNewlineDecoder.
 +
 +- Issue #8515: Set __file__ when run file in IDLE.
 +  Initial patch by Bruce Frederiksen.
 +
 +- Issue #14496: Fix wrong name in idlelib/tabbedpages.py.
 +  Patch by Popa Claudiu.
 +
 +- Issue #3033: Add displayof parameter to tkinter font. Patch by Guilherme Polo.
 +
 +- Issue #14482: Raise a ValueError, not a NameError, when trying to create
 +  a multiprocessing Client or Listener with an AF_UNIX type address under
 +  Windows.  Patch by Popa Claudiu.
 +
 +- Issue #802310: Generate always unique tkinter font names if not directly passed.
 +
 +- Issue #14151: Raise a ValueError, not a NameError, when trying to create
 +  a multiprocessing Client or Listener with an AF_PIPE type address under
 +  non-Windows platforms.  Patch by Popa Claudiu.
 +
 +- Issue #14493: Use gvfs-open or xdg-open in webbrowser.
 +
 +
 +What's New in Python 3.3.0 Alpha 2?
 +===================================
 +
 +*Release date: 01-Apr-2012*
 +
 +Core and Builtins
 +-----------------
 +
 +- Issue #1683368: object.__new__ and object.__init__ raise a TypeError if they
 +  are passed arguments and their complementary method is not overridden.
 +
  - Issue #14378: Fix compiling ast.ImportFrom nodes with a "__future__" string as
    the module name that was not interned.