Skip to content

Conversation

@Victor239
Copy link
Contributor

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.

Copilot AI and others added 2 commits November 24, 2025 19:30
Changed line 264 in etesync_dav/radicale_main/server.py from:
  rlist = xlist = []
to:
  rlist, xlist = [], []

This fixes a critical bug where both variables pointed to the same list,
causing select.select() to receive the same sockets for both readable
and exceptional conditions, leading to inefficient event handling and
high CPU usage.

Co-authored-by: Victor239 <[email protected]>
Copy link
Member

@tasn tasn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duh, thanks!

@tasn tasn merged commit 07222ff into etesync:master Jan 8, 2026
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

Successfully merging this pull request may close these issues.

etesync-dav uses 1½ hours of CPU time in 43 hours

2 participants