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: set changed size during iteration #496

Closed
janbuchar opened this issue Sep 12, 2022 · 2 comments · Fixed by #498
Closed

RuntimeError: set changed size during iteration #496

janbuchar opened this issue Sep 12, 2022 · 2 comments · Fixed by #498
Labels

Comments

@janbuchar
Copy link

  • uvloop version: 0.16.0
  • Python version: 3.10.2
  • Platform: 64-bit Linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: not able to test
  • Does uvloop behave differently from vanilla asyncio? How?: not able to test

I run a fastapi application with uvicorn, and I occassionally receive the following error:

Traceback (most recent call last):
  File "uvloop/cbhandles.pyx", line 66, in uvloop.loop.Handle._run
  File "uvloop/loop.pyx", line 473, in uvloop.loop.Loop._on_idle
  File "uvloop/loop.pyx", line 649, in uvloop.loop.Loop._exec_queued_writes
RuntimeError: set changed size during iteration

This seems to only happen in a production environment and I don't have the resources to examine it further. However, it seems that the code in the uvloop master branch is different, so maybe the error has been fixed already.

@fantix fantix added the bug label Sep 13, 2022
@fantix
Copy link
Member

fantix commented Sep 13, 2022

Thanks for the report! I can reproduce this issue, and it is a bug that sometimes happens when writing to another transport in the resume_writing() handler. I'll try to fix it and include the fix in the next release.

@janbuchar
Copy link
Author

Thank you @fantix for resolving this so fast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants