Benjamin Ash added the comment:
Hi Charles-François,
I am using a recent version of Python-2.7 that does in fact contains this patch
http://hg.python.org/cpython/rev/16bc59d37866:
python-2.7.3-4.fc16.x86_64 (Fedora 16)
The CPU usage spikes after I make the initial client connection to the
Benjamin Ash added the comment:
After doing a bit more testing, I was able to prevent the problem from
occurring in asyncore_test.py with the following patch:
--- /proc/self/fd/112013-02-04 11:24:41.298347199 -0500
+++ asyncore_test.py2013-02-04 11:24:40.393318513 -0500
@@ -19,10
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
Benjamin Ash added the comment:
Ok, thanks for quick followup. I didn't realize that the patch for Python-3,
sorry about that.
The issue I had was due to never calling self.listen() in the constructor of
my server (asyncore.dispatcher). If this is not done the CPU spikes to 100%.
Thanks
Charles-François Natali added the comment:
I'm unable to reproduce it.
Are you using the attached script?
Did you apply the patch by hand, or are you using a recent Python version?
--
___
Python tracker rep...@bugs.python.org
Benjamin Ash added the comment:
Hi,
I am still seeing this issue even with the patches applied. I see 100% CPU
utilization, and strace shows the process is in same kind of select() loop as
msg139899.
Any help would be greatly appreciated.
Thanks,
-ben
strace output:
select(4, [3], [3],
Charles-François Natali neolo...@free.fr added the comment:
Patch committed, closing.
Alexey, thanks for reporting this.
(I'll open a separate issue to increase the tests coverage).
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
versions: +Python 2.7, Python 3.1, Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12502
___
Changes by Giampaolo Rodola' g.rod...@gmail.com:
--
versions: -Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12502
___
___
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
Removed message: http://bugs.python.org/msg140388
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12502
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
Woops, I don't know how, but I removed a neologix's message:
Patch committed, closing.
Alexey, thanks for reporting this.
(I'll open a separate issue to increase the tests coverage).
--
nosy: +haypo
Roundup Robot devnull@devnull added the comment:
New changeset 16bc59d37866 by Charles-François Natali in branch '2.7':
Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
http://hg.python.org/cpython/rev/16bc59d37866
--
nosy: +python-dev
Roundup Robot devnull@devnull added the comment:
New changeset 42ec507815d2 by Charles-François Natali in branch '3.1':
Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
http://hg.python.org/cpython/rev/42ec507815d2
--
___
Python tracker
Roundup Robot devnull@devnull added the comment:
New changeset ed90c1c8ee62 by Charles-François Natali in branch '3.2':
Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
http://hg.python.org/cpython/rev/ed90c1c8ee62
--
___
Python
Roundup Robot devnull@devnull added the comment:
New changeset ca077f2672e3 by Charles-François Natali in branch 'default':
Merge - Issue #12502: asyncore: fix polling loop with AF_UNIX sockets.
http://hg.python.org/cpython/rev/ca077f2672e3
--
___
Charles-François Natali neolo...@free.fr added the comment:
Looks good, the patch seems to fix the problem.
Alright.
Giampaolo, do you agree?
Also, I noticed that test_asyncore currently only tests AF_INET sockets.
I'm working a patch to add AF_UNIX (and maybe AF_INET6) tests.
--
Giampaolo Rodola' g.rod...@gmail.com added the comment:
Sorry for delay. Yes, patch looks ok to me and some tests for AF_UNIX sockets
would definitively be welcome.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12502
New submission from Алексей Агапитов marwinx...@gmail.com:
When using asyncore server with UNIX socket, I got 100% CPU usage.
I run modified code example from asyncore doc page.
This code was tested on two systems:
Ubuntu 10.04 2.6.32-32-generic #62-Ubuntu SMP
with two versions of Python:
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +giampaolo.rodola
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12502
___
___
Python-bugs-list
Charles-François Natali neolo...@free.fr added the comment:
It's looping in Lib/asyncore.py:poll
select(4, [3], [3], [3], {30, 0}) = 1 (out [3], left {29, 94})
select(4, [3], [3], [3], {30, 0}) = 1 (out [3], left {29, 94})
select(4, [3], [3], [3], {30, 0}) = 1 (out
Ross Lagerwall rosslagerw...@gmail.com added the comment:
Looks good, the patch seems to fix the problem.
This section of code indicates that the accepting socket shouldn't be in the
write set...
def handle_write_event(self):
if self.accepting:
# Accepting sockets shouldn't get a
21 matches
Mail list logo