Skip to content

False positive error trigger when using sentry in streamlit #56

Description

@RHDZMOTA

The following error is triggered when forcing a reload of a streamlit page:

RuntimeError: generator didn't stop

Full error:

2024-03-09 23:40:17,975 [ERROR] asyncio: Exception in callback _HandlerDelegate.execute.<locals>.<lambda>(<Task finishe...didn't stop")>) at /home/rhdzmota/Documents/Github/rhdzmota/package.rhdzmota.com/venv/lib/python3.10/site-packages/tornado/web.py:2438
handle: <Handle _HandlerDelegate.execute.<locals>.<lambda>(<Task finishe...didn't stop")>) at /home/rhdzmota/Documents/Github/rhdzmota/package.rhdzmota.com/venv/lib/python3.10/site-packages/tornado/web.py:2438>
Traceback (most recent call last):
  File "/home/rhdzmota/.pyenv/versions/3.10.12/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/rhdzmota/Documents/Github/rhdzmota/package.rhdzmota.com/venv/lib/python3.10/site-packages/tornado/web.py", line 2438, in <lambda>
    fut.add_done_callback(lambda f: f.result())
  File "/home/rhdzmota/Documents/Github/rhdzmota/package.rhdzmota.com/venv/lib/python3.10/site-packages/sentry_sdk/integrations/tornado.py", line 75, in sentry_execute_request_handler
    with _handle_request_impl(self):
  File "/home/rhdzmota/.pyenv/versions/3.10.12/lib/python3.10/contextlib.py", line 146, in __exit__
    raise RuntimeError("generator didn't stop")

Here's the reference to the streamlit tornado implementation: https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/tornado.py

And here is reference to a streamlit-dev conversation about this same issue. Apparently stopping to use cache_data may solve the problem temporarily... but the root-cause of the problem is not clear.
https://discuss.streamlit.io/t/runtimeerror-generator-didnt-stop/44675

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions