You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when running the worker (from cli or with a custom class) the subscribe() method does not pass any exception_handler to self.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:
try:
pubsub.get_message(ignore_subscribe_messages=True, timeout=sleep_time)
except BaseException as e:
if self.exception_handler is None:
raise
self.exception_handler(e, pubsub, self)
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 to rescue 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:
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?
or you want the user to be able to specify a custom handler?
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: