fix: recycle webpool container on TERMINATED sessions too
terminate_session_record was explicitly skipping WEBPOOLIDX containers. Now stops portal-webpool-N in a background thread on any session close, so ensure_web_pool recreates it fresh for the next user.
This commit is contained in:
+9
-2
@@ -745,8 +745,15 @@ def terminate_session_record(
|
|||||||
return
|
return
|
||||||
old_status = sess.status
|
old_status = sess.status
|
||||||
cid = sess.container_id or ""
|
cid = sess.container_id or ""
|
||||||
if stop_container and cid and not cid.startswith(("POOL:", "POOLIDX:", "WEBPOOLIDX:", "RDPSLOT:")):
|
if stop_container and cid:
|
||||||
stop_runtime_container(cid)
|
if cid.startswith("WEBPOOLIDX:"):
|
||||||
|
try:
|
||||||
|
slot = int(cid.split(":", 1)[1])
|
||||||
|
threading.Thread(target=stop_runtime_container, args=(web_pool_container_name(slot),), daemon=True).start()
|
||||||
|
except Exception:
|
||||||
|
logger.exception("webpool_slot_recycle_failed cid=%s", cid)
|
||||||
|
elif not cid.startswith(("POOL:", "POOLIDX:", "RDPSLOT:")):
|
||||||
|
stop_runtime_container(cid)
|
||||||
if cid.startswith("RDPSLOT:"):
|
if cid.startswith("RDPSLOT:"):
|
||||||
try:
|
try:
|
||||||
slot_id = int(cid.split(":", 1)[1])
|
slot_id = int(cid.split(":", 1)[1])
|
||||||
|
|||||||
Reference in New Issue
Block a user