[Twisted-Python] mystery exception

I am writing network proxy, based on proxy.py code. I am also using getPage() and deffered. From time to time I am getting this mystery exception, the source of which I could not track. Does anybody knows what could be causing it? I am pretty sure I am not closing any sokets twice in my code. The code writing 'x' seems weird to me. Traceback (most recent call last): File "/usr/lib64/python2.5/threading.py", line 460, in __bootstrap self.run() File "/usr/lib64/python2.5/threading.py", line 440, in run self.__target(*self.__args, **self.__kwargs) --- <exception caught here> --- File "/usr/lib/python2.5/site-packages/twisted/python/threadpool.py", line 161, in _worker context.call(ctx, function, *args, **kwargs) File "/usr/lib/python2.5/site-packages/twisted/python/context.py", li ne 59, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw ) File "/usr/lib/python2.5/site-packages/twisted/python/context.py", li ne 37, in callWithContext return func(*args,**kw) File "/usr/lib/python2.5/site-packages/twisted/internet/threads.py", line 29, in _putResultInDeferred reactor.callFromThread(deferred.callback, result) File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 824, in callFromThread self.wakeUp() File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 443, in wakeUp self.waker.wakeUp() File "/usr/lib/python2.5/site-packages/twisted/internet/posixbase.py", line 138, in wakeUp util.untilConcludes(os.write, self.o, 'x') File "/usr/lib/python2.5/site-packages/twisted/python/util.py", line 757, in untilConcludes return f(*a, **kw) exceptions.OSError: [Errno 32] Broken pipe My OS is: Linux xxxx 2.6.23.1-42.fc8 #1 SMP Tue Oct 30 13:18:33 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux and I am using latest version of Twisted. Sincerely, Vadim

On Tue, 14 Oct 2008 18:14:47 -0700, Vadim Zaliva <krokodil@gmail.com> wrote:
Something in your program broke the reactor. Or you found a bug in the reactor which causes it to break itself. It doesn't seem likely anyone will be able to figure out which or how without seeing your actually source, though. If you can provide a minimal example of this, and it's a bug in Twisted, we should be able to fix it. This is a pretty central piece of functionality, though, and it gets exercised all the time, so chances are good that there's something in your program that's causing it. The specific problem is that a pipe file descriptor, internal to the reactor, has been closed. The reactor is not expecting this to happen, and it shouldn't, since it never closes it. Jean-Paul

On Oct 14, 2008, at 20:31, Vadim Zaliva wrote:
This is the daemonisation code I am using: http://pastebin.com/mf54c5cd It seems that it is causing the problem. Vadim

On Tue, 14 Oct 2008 18:14:47 -0700, Vadim Zaliva <krokodil@gmail.com> wrote:
Something in your program broke the reactor. Or you found a bug in the reactor which causes it to break itself. It doesn't seem likely anyone will be able to figure out which or how without seeing your actually source, though. If you can provide a minimal example of this, and it's a bug in Twisted, we should be able to fix it. This is a pretty central piece of functionality, though, and it gets exercised all the time, so chances are good that there's something in your program that's causing it. The specific problem is that a pipe file descriptor, internal to the reactor, has been closed. The reactor is not expecting this to happen, and it shouldn't, since it never closes it. Jean-Paul

On Oct 14, 2008, at 20:31, Vadim Zaliva wrote:
This is the daemonisation code I am using: http://pastebin.com/mf54c5cd It seems that it is causing the problem. Vadim
participants (3)
-
glyph@divmod.com
-
Jean-Paul Calderone
-
Vadim Zaliva