Skip to content

Thread safety: clients list has no locking #1

@davidnoyes

Description

@davidnoyes

Bug Description

The clients list is read and written from multiple threads at the same time — one thread per connected client, the main GUI thread, and the cleanup timer. There is no threading.Lock protecting it. This can cause crashes, skipped items, or corrupted data.

File & Lines

server code.py — lines 37, 216, 338, 751

Example Locations

  • clients.append(client) (line 338)
  • list(clients) in broadcast (line 216)
  • clients.remove(client) in cleanup (line 751)

Severity

Critical — can crash the server under load.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions