On Sat, Oct 6, 2012 at 5:54 AM, Ben Darnell <b
...@bendarnell.com> wrote:
> Maybe you need to call io_loop.remove_handler() when the state is
> POLL_OK? The IOLoop always listens for at least ERROR events on all
> registered fds (maybe we should just get rid of that NONE constant;
> I'm not sure if it ever makes sense). If you really don't even care
> about errors on the connection, removing the handler seems like the
> right thing to do. If the connection was closed I think you'd
> continually get ERROR events until you removed the handler.
> -Ben
> On Fri, Oct 5, 2012 at 5:58 AM, Frank Smit <fr...@61924.nl> wrote:
>> Hi,
>> I've been rewriting Momoko and trying some new things and I
>> encountered a bug when implementing transactions. I've isolated the
>> code and reproduce the problem. It's probably me doing something
>> wrong, but I can't figure out what.
>> Here is the code:
>> https://gist.github.com/3839266
>> After a connection is made, the `io_callback` is called a fe times
>> (around 5 times). Then a query is made and `io_callback` is called
>> constantly. It doesn't stop even after the state is `POLL_OK`.
>> Here is a snippet of the output. The number show the times
>> `io_callback` has been caled before I aborted the script.
>> 53687 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53688 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53689 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53690 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53691 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53692 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53693 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53694 POLL_OK IOLoop.NONE
>> Test conn: <__main__.Connection object at 0x1c4ef90>
>> 53695 POLL_OK IOLoop.NONE
>> Anyone knows how this fix this?