From: Antoine Pitrou Date: Sun, 8 Apr 2012 22:49:17 +0000 (+0200) Subject: Issue #7978: socketserver now restarts the select() call when EINTR is returned. X-Git-Tag: v3.3.0a3~285 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c9e8e3c4dd2cfb3506e9b4b3b87d27727fca4b5d;p=python 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. --- c9e8e3c4dd2cfb3506e9b4b3b87d27727fca4b5d diff --cc Lib/socketserver.py index a487e63761,c8a8db1950..261e28e641 --- a/Lib/socketserver.py +++ b/Lib/socketserver.py @@@ -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 800e88435d,3693c1c575..cab01d423d --- a/Misc/ACKS +++ 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 af1b5d0b1e,924c7dcb93..6256e02575 --- a/Misc/NEWS +++ 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.