It is also what Victor Stinner said at first, but I am quite sure it is. Also I proposed to inherit from Future to improve the cancel() call and made this patch: https://github.com/aio-libs/aioredis/pull/59/files
Could you tell me if it is the right way to do it? Le mercredi 8 avril 2015 14:21:03 UTC+2, Gustavo Carneiro a écrit : > > > > On 8 April 2015 at 11:14, Rémy Hubscher <hubsch...@gmail.com <javascript:> > > wrote: > >> Hello, >> >> I am using aioredis on a BLPOP which is a blocking call on a redis >> connection. >> >> redis.blpop is a Future created here: >> https://github.com/aio-libs/aioredis/blob/master/aioredis/connection.py#L154-L157 >> >> When using asyncio.wait_for(redis.blpop("channel"), timeout=5) if the >> timeout is raised before the blpop happens a asyncio.CancelledError is >> raised and the Future is marked as cancelled. >> >> Later in the code I am asking for another redis.blpop("channel") and the >> next message is not catched because the cancelled task consume it >> nevertheless. >> > > This sounds like this bug: http://bugs.python.org/issue23812 > > >> >> I have created a peace of code to reproduce the problem: >> https://github.com/aio-libs/aioredis/issues/59#issue-66158818 >> >> Do you have any idea of how I can handle this CancelledError in aioredis >> in order to really cancel the Future? >> >> Thank you for your help. >> >> Kind regards, >> >> Rémy >> > > > > -- > Gustavo J. A. M. Carneiro > Gambit Research > "The universe is always one step beyond logic." -- Frank Herbert >