New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AlreadyCalledError in twisted connection adapter #1282
Comments
Hi I'm assuming this is your message on the mailing list - https://groups.google.com/d/topic/pika-python/OaHcH2tJtjo/discussion I'm hoping @abompard can help out as I'm not familiar with the Twisted adapter. How common is it to cancel an operation before running it? My guess is this is not a common scenario. |
I'll have a look! |
OK, I see where this comes from, and indeed cancelling those deferreds is not supported at the moment. I can make Pika ignore the error, but maybe we can do better. @lukebakken is there a way in Pika to cancel a call that has been made? Say I'm calling |
There is no way that I know of to cancel a call that is made. If @vitaly-krugl is around he could chime in. How common is this scenario? Does it really need to be fixed? |
@sekogan Could you tell us more about why you are cancelling this deferred, in which context, and what you would expect to happen? |
@abompard For example I use cancellations to stop coroutines performing lengthy operations. Imagine a coroutine named "consumer" which declares a queue, calls basic_consume and handles messages somehow. To stop it I cancel the deferred returned by that coroutine. The deferred forwards cancellation to the deferred it is waiting for which forwards it again and so on. The last deferred in that chain typically raises Another example is adding a timeout to a coroutine which performs something that includes calls to pika API like The code above is just a minimal example reproducing the issue. It doesn't really make sense to cancel I would expect pika to either fail explicitly and as early as possible if cancellations are not supported or abandon the underlying operation and discard its outcome if cancellations are supported. It would also be nice to have cancellations mentioned in the documentation. |
I will investigate this before the next major release, thank you! |
Hi!
I am having trouble with the following scenario:
It fails every time:
Full log with debug messages from pika
Using pika 1.1.0, twisted 19.10.0 and python 2.7.14.
The text was updated successfully, but these errors were encountered: