etesync-dav icon indicating copy to clipboard operation
etesync-dav copied to clipboard

Fix high CPU usage from shared list reference in select() event loop

Open Victor239 opened this issue 1 month ago • 0 comments

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.

Victor239 avatar Nov 30 '25 11:11 Victor239