fix(tv-cdp): reserve TVs until retiring leases drain

Merged
TH
2d ago
+628-264

Summary

Keep a TV reserved until the retiring lease’s admitted operations drain and its vendor tunnel removal is confirmed. Release revokes the lease immediately and disconnects CDP. Each removal keeps its own cleanup record. Concurrent releases share the current cleanup attempt. Each open, close, or release teardown wait retries previously failed removals once and joins pending attempts. Release also invalidates in-flight allocation for the same lease. The TV CDP runtime and the Tizen and webOS transports preserve errors from both app operations and cleanup.

Before / after

  • allocate(leaseB) could succeed while lease A was listing apps or after tunnel removal failed. It now returns DEVICE_IN_USE until operations drain and removal succeeds.
  • A retained binding rejects new operations as soon as its lease retires, including after a replacement takes the TV.

Validation

Head 139c47c89714abb2f859214745fe9956c7a2270b. All 21 CI checks passed on this head. Runtime tests cover open and close recovery after a cancelled open, retention after another failure, and concurrent releases sharing a retry before handoff. CI can validate these regressions and Tizen forward-removal behavior with fakes. SDB 4.2.36 static inspection found a successful forward --list can omit rows when its 1 KiB server buffer fills. Failed removal still retains the reservation when absence cannot be confirmed. Live TV evidence is outstanding. The available workflows showed no Tizen or webOS hardware or Tizen emulator lane for the requested handoff and vendor cleanup trace.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.