etesync-dav
etesync-dav copied to clipboard
Fix high CPU usage from shared list reference in select() event loop
This resolves #206 and #344. I had been having these CPU usage issues for a long time, this fix completely solved my issues.
The server event loop was consuming up to 100% CPU due to a single-line bug where rlist and xlist referenced the same list object, causing select.select() to monitor identical sockets for both read and exceptional events.
Changes:
- Fixed line 264 in
etesync_dav/radicale_main/server.py:# Before: both variables reference the same list rlist = xlist = [] # After: separate list objects rlist, xlist = [], []
This ensures xlist remains empty as intended, allowing the event loop to properly block until events occur instead of busy-looping.