Skip to content

Commit 07222ff

Browse files
Victor239Copilot
andauthored
Fix high CPU usage from shared list reference in select() event loop (#361)
* Initial plan * Fix high CPU usage bug in server event loop 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 <12621257+Victor239@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 91ceb92 commit 07222ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

etesync_dav/radicale_main/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def serve(configuration, shutdown_socket):
261261
max_connections = configuration.get("server", "max_connections")
262262
logger.info("Radicale server ready")
263263
while True:
264-
rlist = xlist = []
264+
rlist, xlist = [], []
265265
# Wait for finished clients
266266
for server in servers.values():
267267
rlist.extend(server.client_sockets)

0 commit comments

Comments
 (0)