openpilot icon indicating copy to clipboard operation
openpilot copied to clipboard

ui: fix thread-safety issue by passing a copy of the network list to callbacks

Open deanlee opened this issue 1 month ago • 3 comments

Previously, the original mutable network list (self._networks) was passed directly to callbacks. This could cause race conditions.

Example from logging:


Enqueuing callback: <bound method NetworkLayoutMici._on_network_updated of <...NetworkLayoutMici object at 0x7f638b3e3390>> with args: id: 140065515005056
Processing network update in UI with arg id: 140065515005056

The same object ID appears in both threads, confirming that the mutable object was shared.

Change: Pass a copy of the network list to callbacks to ensure each thread works with an independent, thread-safe snapshot.

deanlee avatar Dec 10 '25 08:12 deanlee

mici raylib UI Preview

✅ Videos are identical! View Diff Report

github-actions[bot] avatar Dec 10 '25 08:12 github-actions[bot]

raylib UI Preview

All Screenshots

github-actions[bot] avatar Dec 10 '25 08:12 github-actions[bot]

Why close?

sshane avatar Dec 10 '25 23:12 sshane