Best-effort: release any libfastled_build locks held by this PID. Called from the watchdog before force-exit so subsequent runs don't block on a stale lock from this hung process. Intentionally suppresses KeyboardInterrupt: the watchdog's caller (deadman_timer / watchdog_timer) is a
()
| 196 | |
| 197 | |
| 198 | def _release_held_build_locks() -> None: |
| 199 | """Best-effort: release any libfastled_build locks held by this PID. |
| 200 | |
| 201 | Called from the watchdog before force-exit so subsequent runs don't |
| 202 | block on a stale lock from this hung process. Intentionally suppresses |
| 203 | KeyboardInterrupt: the watchdog's caller (deadman_timer / watchdog_timer) |
| 204 | is about to call os._exit(), so cleanup must run to completion regardless |
| 205 | of signal state. Re-raising would short-circuit the force-exit. |
| 206 | """ |
| 207 | try: |
| 208 | from ci.util.lock_database import get_lock_database # noqa: PLC0415 |
| 209 | |
| 210 | db = get_lock_database() |
| 211 | my_pid = os.getpid() |
| 212 | for lock in db.list_all_locks(): |
| 213 | if lock["owner_pid"] == my_pid: |
| 214 | try: |
| 215 | db.release(lock["lock_name"], my_pid) |
| 216 | except KeyboardInterrupt as ki: |
| 217 | handle_keyboard_interrupt(ki) |
| 218 | except Exception: |
| 219 | pass |
| 220 | except KeyboardInterrupt as ki: |
| 221 | handle_keyboard_interrupt(ki) |
| 222 | except Exception: |
| 223 | pass |
| 224 | |
| 225 | |
| 226 | def make_watch_dog_thread( |
no test coverage detected