-
Notifications
You must be signed in to change notification settings - Fork 35
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
KeyError when checking if channel should be recycled #8
Comments
We're seeing the same problem -- have you got some interesting workaround? |
Nope, not found a resolution yet. The queue section of my project is currently on hold. @mayhem What Python version are you using? However, it seems to be an issue with the hashing I believe? |
3.6 here -- I'm going to review the whole code in a little while and see if I can spot any obvious mistakes. |
3.6 here too. Maybe a recent update to Python broke this extension? Let me know when you find anything |
There are several things about this module I dislike -- for instance why are recycle times not stored with channels? They could just be in one dict in the queue and that would ensure they could not get separated. |
A rewrite is in place? |
I'm probably going to abandon Flask-pika, and use pika-pool instead. |
Yep, https://pypi.python.org/pypi/pika-pool seems a lot more solid. Better interface too. |
I'll leave this issue open until someone at WDTInc wishes to look at this and/or if another user comes here looking for a solution. |
We haven't seen this behavior... I will note that we are on python 2.7 where this extension is used. |
I had the same problem.
below is part of log, search
and then,
more test: # flask_pika.Pika#channel
def channel(self):
....
# add support context manager
def close():
self.return_channel(ch)
ch = ProxyContextManager(instance=ch, close_callback=close) here is my PR:#9 |
I am seeing this issue now as well, Python 3.5.6, Flask- Pika 0.3.8, Flask 1.0.2 and the latest RabbitMQ docker (rabbitmq:3.6.11-management-alpine) Any way I can workaround this?
|
I'm also affected by this. Using the latest pip release of flask-pika in Python 3.6.9 |
@youzipi tks for your report and I have some other suggestions. For my understanding, ProxyContextManager is a proxy that needs to be transparent. So, we can only modify the hash method to return the proxied instance's hash. like this: class ProxyContextManager(object):
""" ... """
def __hash__(self):
return hash(self.instance) And this is my PR, #12 |
After 16 requests, the error starts occurring.
The params:
The trace stack is shown below
The code that gets executed every request.
The text was updated successfully, but these errors were encountered: