dictionary changed size during iteration
See original GitHub issueHi there!
I’ve just upgraded from cheroot==8.4.4
to cheroot==8.4.5
and I noticed what looks like a regression.
❓ I’m submitting a …
- 🐞 bug report
🐞 Describe the bug. What is the current behavior?
I see this in my server logs:
Error in HTTPServer.tick
Traceback (most recent call last):
File ".../lib/site-packages/cheroot/server.py", line 1798, in serve
self.tick()
File ".../lib/site-packages/cheroot/server.py", line 2046, in tick
self._connections.expire()
File ".../lib/site-packages/cheroot/connections.py", line 105, in expire
in self._selector.get_map().items()
File ".../lib/_abcoll.py", line 414, in items
return [(key, self[key]) for key in self]
RuntimeError: dictionary changed size during iteration
❓ What is the motivation / use case for changing the behavior?
There is occasional log spam (for a low traffic environment), but I assume this has some other undesired side-effects…
💡 To Reproduce
I’m not sure exactly. We have a test environment with synthetic checks that does a couple requests per second and the behaviour occurs “naturally”…
📋 Details
We very recently upgraded from version 8.4.4 to 8.4.5, but it’s possible the error was already present in 8.4.4. We use pip-compile
and cheroot
is not pinned, so we usually get updates shortly after they are released.
📋 Environment
- Cheroot version: 8.4.5
- CherryPy version: 17.4.2 (I don’t think we really use it)
- Python version: 2.7
- OS: Windows
- Browser: requests
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Thanks a lot for the fix! I’m rolling that out to our test environments and will confirm the fix later this week 😃
Fix from #337 is now released as 8.4.8. Please verify the fix and report back here. Thanks!