A body opens a session, Sunshine keeps the app running with no client attached, no head ever adopts the record, and nothing in the cluster can ever close it. The body slot is held until an operator closes the app by hand.
WHY NO WATCHDOG CATCHES IT (pkg/api/session_watchdog.go)
MEASURED, Mercator bed, venue cloud-seven
OPERATOR WORKAROUND
curl -sk -u sunshine:sunshine -X POST -H 'Content-Type: application/json' -d '{}' https://:47990/api/apps/close
Then serverinfo on 47989 must read SUNSHINE_SERVER_FREE. The cluster releases the slot about 15 s later.
FIX
An adoption deadline in the watchdog: reap a session only when all four hold - the head heartbeat is zero, the body reports no streaming client, the session is older than 5 minutes, and no online head names that body in LiveBodyID. The stop must go out on the LEGACY body-wide path, because an owned stop is fenced on a client uuid the orphan does not have. Adoption was measured at 39 s to 92 s, so the deadline is more than three times the worst observed wait.
A session that is unadopted but DOES carry a client uuid is left alone: it may be a viewer paired straight to Sunshine, which no cluster record can rule out.
Related: #816 (a streaming head reported as self-service), #663 / #711 (body allocation), #504 (the designed slot allocator).