ironport/shrapnel — pull request #25 by sgalaburda (2012-06-13 10:11:04+00:00)
Title: The fix for issue with AttributeError appfaults under Linux.

I created a simple HTTP server based on coro.http. Running it on my Linux box. Under load the server starts to spit AttributeErrors in the logs:

11191: Wed Jun 13 09:07:04 2012 thread 11191 (server connection on ('10.62.96.163', 40427)): error '(\'linux_poller.pyx coro._coro.queue_poller.set_wait_for (coro/_coro.c:16533)|198\', "", "\'coro._coro.coro\' object has no attribute \'target\'", \'[_coro.pyx coro._coro._wrap1 (coro/_coro.c:9844)|778] [http/server.py run|75] [http/server.py gen_requests|54] [_coro.pyx coro._coro.sched.with_timeout (coro/_coro.c:13494)|1131] [http/server.py get_request|33] [coro/read_stream.py read_line|104] [coro/read_stream.py read_until|85] [coro/read_stream.py |83] [coro/read_stream.py gen_read_until|25] [coro/read_stream.py next|8] [socket.pyx coro._coro.sock.recv (coro/_coro.c:20566)|552] [socket.pyx coro._coro.sock._wait_for_read (coro/_coro.c:24165)|1069] [linux_poller.pyx coro._coro.queue_poller._wait_for_read (coro/_coro.c:17127)|257] [linux_poller.pyx coro._coro.queue_poller._wait_for_with_eof (coro/_coro.c:17047)|250] [linux_poller.pyx coro._coro.queue_poller._wait_for (coro/_coro.c:17241)|265] [linux_poller.pyx coro._coro.queue_poller.set_wait_for (coro/_coro.c:16533)|198]\')'

It looks like the problem is in the linux_poller.pyx::queue_poller.set_wait_for() line 198:

raise SimultaneousError (the_scheduler._current, et.target, ek)

according to SimultaneousError constructor signature it should be:

raise SimultaneousError (the_scheduler._current, et, ek)