Skip to content
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

anyio>=4.0 breaks our backend implementations #1167

Open
Archmonger opened this issue Dec 6, 2023 · 0 comments
Open

anyio>=4.0 breaks our backend implementations #1167

Archmonger opened this issue Dec 6, 2023 · 0 comments
Labels
priority-1-high Should be resolved ASAP. type-bug About something that isn't working

Comments

@Archmonger
Copy link
Contributor

Current Situation

Looks like some changes to the latest versions of anyio fundamentally breaks how we currently spawn our backends.

Exception in thread Thread-3 (run_dispatcher):
Traceback (most recent call last):
  File "C:\Users\Markg\Documents\Repositories\_testbed\.venv\lib\site-packages\reactpy\backend\flask.py", line 225, in main
    await serve_layout(
  File "C:\Users\Markg\Documents\Repositories\_testbed\.venv\lib\site-packages\reactpy\core\serve.py", line 42, in serve_layout
    async with create_task_group() as task_group:
  File "C:\Users\Markg\Documents\Repositories\_testbed\.venv\lib\site-packages\anyio\_backends\_asyncio.py", line 668, in __aexit__
    raise cancelled_exc_while_waiting_tasks
  File "C:\Users\Markg\Documents\Repositories\_testbed\.venv\lib\site-packages\anyio\_backends\_asyncio.py", line 648, in __aexit__
    await asyncio.wait(self.cancel_scope._tasks)
  File "C:\Users\Markg\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 384, in wait
    return await _wait(fs, timeout, return_when, loop)
  File "C:\Users\Markg\AppData\Local\Programs\Python\Python310\lib\asyncio\tasks.py", line 491, in _wait
    await waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Markg\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "C:\Users\Markg\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\Markg\Documents\Repositories\_testbed\.venv\lib\site-packages\flask\ctx.py", line 181, in wrapper
    return reqctx.app.ensure_sync(f)(*args, **kwargs)
  File "C:\Users\Markg\Documents\Repositories\_testbed\.venv\lib\site-packages\reactpy\backend\flask.py", line 253, in run_dispatcher
    loop.run_until_complete(main_future)
  File "C:\Users\Markg\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 649, in run_until_complete
    return future.result()
asyncio.exceptions.CancelledError

Proposed Actions

Create compatibility for anyio>=4.0, or limit anyio to <4.0.

@Archmonger Archmonger added type-bug About something that isn't working priority-1-high Should be resolved ASAP. labels Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-1-high Should be resolved ASAP. type-bug About something that isn't working
Projects
None yet
Development

No branches or pull requests

1 participant