New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
asyncore infinite loop on raise #53895
Comments
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. |
What change are you proposing? |
Could you provide a code sample which demonstrates the problem? |
First it depends on the socket type but might use a select call, secondable the asyncchat is a looper if you don't let him catch the exception you just On Wed, Aug 25, 2010 at 3:45 PM, Giampaolo Rodola'
|
I agree with you that asyncore API model is far from being robust and I've personally seen infinite recursion more than once if certain asyncore methods aren't properly subclassed. What I don't understand is what changes you are proposing and, again, it would be very helpful if you could provide an example code which demonstrates the problems you're complaining about (infinite recursion? broken pipe error? both?). |
I am closing this because there is no identified, fixable implementation bug in any particular Python module. The fix for the asyncore *design* will be a new, re-designed module. |
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: