[New-bugs-announce] [issue9686] asyncore infinite loop on raise

mmw report at bugs.python.org
Wed Aug 25 21:41:33 CEST 2010


New submission from mmw <0xcafefeed at gmail.com>:

def send(self, data):
        try:
            result = self.socket.send(data)
            return result
        except socket.error, why:
            if why.args[0] == EWOULDBLOCK:
                return 0
            elif why.args[0] in (ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED):
                self.handle_close()
                return 0
            else:
                raise

for whatever reason the connection could break client side, if you raise an anonymous exception there it's uncatchable, raise on a socket.error or dismiss async chat is a looper.

that's the main reason why everybody gets this crazy infinite loop on for instance broken pipe error and the thing never exit, you just raise on your-self other and other again, 

BTW, you could have the same issue whatever the language, this is a developer bug.

----------
components: Library (Lib)
messages: 114931
nosy: mmw
priority: normal
severity: normal
status: open
title: asyncore infinite loop on raise
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9686>
_______________________________________


More information about the New-bugs-announce mailing list