[Twisted-Python] potential bug in the reactor's handling events loop

Python 2.3, one of the latest Twisted version: I noted that under Linux there is not way to Control-C the reactor loop. After digging a little I found that following change helps: [root@d1501-0a10109c internet]# diff base.py{,.ori}
302d301 < print "1",sysEvtTriggers 305d303 < print "2",`self._eventTriggers` 307,308c305 < for callable, args, kw in sysEvtTriggers[1]: < print "3" ---
for callable, args, kw in sysEvtTriggers[0]:
317d313 < print "4" 320d315 < print "5",`eventType` Of course it is quick work around, not a permanent fix, but it really helps. Please advice, Andy

Andrzej Leszczynski wrote:
Python 2.3, one of the latest Twisted version:
Is this list alive. If no, what is the place I might ask for a help. I am quite new to the Python (but no to the development), so sorry for asking such a question. Also I used ACE before, and find Twisted very similar in many regards. What if I would like to contribute to the Twisted project? Thx, A.

On Mar 4, 2005, at 8:38 AM, Andrzej Leszczynski wrote:
I ignored your message because 1) The patch is unreadable, and backwards (please use unified diff format) 2) at first glance appears to just add print statements, and 3) It's not a problem that I've ever had. I suspect other people did the same. James

James Y Knight wrote:
Sorry for the shortcuts. It was not a patch but rather what I touched to make it working. I promise to use diff -u next time. print-s were my way of debugging. Re the problem itself. I still encounter it under newest version of Twisted 1.3 and Python on Linux 2.4. But not on M$. Since it is a part of bigger construct I work on I can just send the sources. As soon as get some time I will send the narrowed down version. For now I can suspect it is related to the threads I use in it extensively. I atested that reactor without those threads is ctrl-c-able. I will come back to that at some point, it still intrigues me and is IMO the best way to learn internals of any framework ... Thx, A.

Le mercredi 02 mars 2005 à 19:39 -0600, Andrzej Leszczynski a écrit :
Python 2.3, one of the latest Twisted version:
I noted that under Linux there is not way to Control-C the reactor loop.
Here it works. (Mandrake Cooker packages) Maybe you should try to upgrade to the latest packages, and then see if it still happens.

On Wed, 02 Mar 2005 19:39:00 -0600, Andrzej Leszczynski <leszczynscy@yahoo.com> wrote:
The change is completely broken, unfortunately :) It executes the "during" triggers in the "before" phase, and entirely skips the "before" triggers. I'll hazard a guess that you're trying to run and stop the reactor twice, and that it only fails on the second attempt. This behavior isn't supported (reactor.run() can only be called once in a process's lifetime). If this isn't the case, could you include a minimal (but complete and self-contained) example which reproduces the undesirable behavior? Jp

Andrzej Leszczynski wrote:
Python 2.3, one of the latest Twisted version:
Is this list alive. If no, what is the place I might ask for a help. I am quite new to the Python (but no to the development), so sorry for asking such a question. Also I used ACE before, and find Twisted very similar in many regards. What if I would like to contribute to the Twisted project? Thx, A.

On Mar 4, 2005, at 8:38 AM, Andrzej Leszczynski wrote:
I ignored your message because 1) The patch is unreadable, and backwards (please use unified diff format) 2) at first glance appears to just add print statements, and 3) It's not a problem that I've ever had. I suspect other people did the same. James

James Y Knight wrote:
Sorry for the shortcuts. It was not a patch but rather what I touched to make it working. I promise to use diff -u next time. print-s were my way of debugging. Re the problem itself. I still encounter it under newest version of Twisted 1.3 and Python on Linux 2.4. But not on M$. Since it is a part of bigger construct I work on I can just send the sources. As soon as get some time I will send the narrowed down version. For now I can suspect it is related to the threads I use in it extensively. I atested that reactor without those threads is ctrl-c-able. I will come back to that at some point, it still intrigues me and is IMO the best way to learn internals of any framework ... Thx, A.

Le mercredi 02 mars 2005 à 19:39 -0600, Andrzej Leszczynski a écrit :
Python 2.3, one of the latest Twisted version:
I noted that under Linux there is not way to Control-C the reactor loop.
Here it works. (Mandrake Cooker packages) Maybe you should try to upgrade to the latest packages, and then see if it still happens.

On Wed, 02 Mar 2005 19:39:00 -0600, Andrzej Leszczynski <leszczynscy@yahoo.com> wrote:
The change is completely broken, unfortunately :) It executes the "during" triggers in the "before" phase, and entirely skips the "before" triggers. I'll hazard a guess that you're trying to run and stop the reactor twice, and that it only fails on the second attempt. This behavior isn't supported (reactor.run() can only be called once in a process's lifetime). If this isn't the case, could you include a minimal (but complete and self-contained) example which reproduces the undesirable behavior? Jp
participants (4)
-
Andrzej Leszczynski
-
Antoine Pitrou
-
James Y Knight
-
Jp Calderone