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

RuntimeError: Task pending got Future attached to a different loop in grpcserver.py #33

Open
therootop opened this issue Dec 10, 2024 · 0 comments

Comments

@therootop
Copy link

  • Django gRPC version: 1.0.21
  • Django version: 4.2.16
  • Python version: 3.12.3
  • Operating System: macOS 14.7.1

Description

I am encountering a RuntimeError when running the gRPC server in my Django project. The error message indicates that a Future object is being awaited on a different event loop than the one it was created on.

What I Did

  1. GRPCSERVER setting in settings.py has 'async': True.
  2. Run the gRPC server using the command: python manage.py grpcserver
  3. Observe the RuntimeError in the console output.
RuntimeError: Task <Task pending name='Task-1' coro=<Command._serve_async.<locals>._main_routine() running at /{path}/lib/python3.12/site-packages/django_grpc/management/commands/grpcserver.py:58> cb=[_run_until_complete_cb() at /{path}/.pyenv/versions/3.12.3/lib/python3.12/asyncio/base_events.py:182]> got Future <Future pending> attached to a different loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant