Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
8.99k stars 5.17k forks source link

Fix possible ordering issue if a callback blocks in button handler #6440

Closed KevinOConnor closed 5 months ago

KevinOConnor commented 6 months ago

Invoke button callbacks directly from the background thread. This ensures that button notifications are delivered and delivered in the correct order. Previously, if a callback blocked, it was possible a new update could start before the previous update was completed, which could lead to lost events or out of order events.

This issue was reported at: https://klipper.discourse.group/t/query-button-unreliable/11452 https://klipper.discourse.group/t/bug-found-with-gcode-button/11932

-Kevin