You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python Version:
===============
Any Python Version
OS Platform:
============
Debian Linux 2.6.8-2-386 #1 Tue Aug 16 12:46:35 UTC 2005 i686 GNU/Linux
Windows XP SP2
Problem:
========
Member function makeSocket() of logging.handlers.SocketHandler creates a socket with no default timeout, and this may block the app on Linux.
defmakeSocket(self):
""" A factory method which allows subclasses to define the precise type of socket they want. """s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((self.host, self.port))
returns
if the log receiver on the destination host is not running, the log sender will block the app on socket.connect(), but on windows, socket.connect() will return immediately. So I propose to provide a default timeout value for makeSocket() like below:
defmakeSocket(self, timeout=1):
""" A factory method which allows subclasses to define the precise type of socket they want. """s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
s.connect((self.host, self.port))
returns
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: