MCPcopy Create free account
hub / github.com/FastLED/FastLED / _release_held_build_locks

Function _release_held_build_locks

test.py:198–223  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

196
197
198def _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
226def make_watch_dog_thread(

Callers 2

deadman_timerFunction · 0.85
watchdog_timerFunction · 0.85

Calls 4

get_lock_databaseFunction · 0.90
list_all_locksMethod · 0.80
releaseMethod · 0.45

Tested by

no test coverage detected