-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
no way to catch the redis.exceptions.ConnectionError on pubsub.get_message #2070
Comments
I think the solution would be to configure bugsnag to ignore this exception. In addition, we can add logging statements around this area so users are aware of this. Mind opening a PR? |
are you suggesting to add a custom exception handler that only logs the issue and pass without re-raising the exception? |
My suggestion was simply to add logging statements so we are aware that this is happening. |
something like this, will be ok? if this is what you mean, I'll create a PR with this changes
|
when running the worker (from cli or with a custom class) the
subscribe()
method does not pass anyexception_handler
toself.pubsub.run_in_thread(sleep_time=0.2, daemon=True)
so if a disconnection from Redis happens while waiting for messages in the pubsub channel, this code (inside redis python driver) is triggered:and since there is no
exception_handler
the exception is raised.the issue is that this code runs in a separate thread
PubSubWorkerThread(threading.Thread)
so there is no way torescue
from it in the worker class.the program works correctly and reconnects after Redis connection is restored, but it's annoying to receive reports from
bugsnag
(setup as global catch all exceptions) for an unhandled exception that can occur sometimes but cannot be "silenced" since it's perfectly fine to get it.The text was updated successfully, but these errors were encountered: