[issue12502] 100% cpu usage when using asyncore with UNIX socket

Charles-François Natali report at bugs.python.org
Mon Feb 4 19:28:33 CET 2013


Charles-François Natali added the comment:

> Using handle_accept() in my code and remembering to call listen() in my
> asyncore.dispatcher server's constructor did the trick.
>
> I am not sure if we still have a bug here though, since if the subclass
> doesn't define  a proper handle_accept() we get into the select() loop and
> 100% CPU utilization after the initial client connection.

No, it's not a bug.
The attached test case was for Python 3: Python 2 doesn't have
handle_accepted(), and since the default implementation of
handle_accept() doesn't nothing, the handler is called in a loop,
because the socket is effectively always ready for accept.

----------

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


More information about the Python-bugs-list mailing list