apache / apache/cloudstack

consoleproxy.session.timeout is honoured for noVNC sessions but not legacy VNC/RDP/AJAX viewers

未關閉
#13,858 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
component:console-proxy
主要語言
Java
星號
3.1k
分支
1.4k
平均合併
6 天 19 小時
30 天內合併 PR
32

描述

### problem

`consoleproxy.session.timeout` is now honoured for noVNC console sessions (#12810, PR #13058), but VNC/RDP/AJAX-based console viewers still rely on a separate, hardcoded idle threshold: `ConsoleProxy.VIEWER_LINGER_SECONDS` (180 seconds), used by `isFrontEndAlive()` in `ConsoleProxyVncClient`, `ConsoleProxyRdpClient`, and `ConsoleProxyNoVncClient`.

This means the effective idle timeout for a console session now depends on which viewer/hypervisor path served it:

- noVNC sessions: idle timeout follows the configured `consoleproxy.session.timeout` (both via `ConsoleProxyGCThread` and, since PR #13058, the WebSocket session's own idle timeout).
- Legacy VNC/RDP/AJAX sessions: idle timeout is still fixed at 180 seconds regardless of the `consoleproxy.session.timeout` setting.

An admin who sets `consoleproxy.session.timeout` to, say, 30 minutes to keep long-idle sessions open will still see legacy VNC/RDP/AJAX sessions get dropped after 3 minutes — an inconsistency that's confusing and undocumented.

### versions

ACS 4.20+ (any branch carrying the PR #13058 / equivalent noVNC timeout fix)

### The steps to reproduce the bug

1. Set the global setting `consoleproxy.session.timeout` to a value well above 180000 ms (e.g. 1800000 ms / 30 minutes).
2. Open a console session that uses the legacy VNC/RDP/AJAX path (e.g. a hypervisor or console mode that doesn't route through noVNC).
3. Leave the session idle.
4. Observe the session is torn down after ~180 seconds, not after the configured `consoleproxy.session.timeout`.
5. Compare against a noVNC console session under the same setting, which correctly honours the configured value.

### What to do about it?

Derive `VIEWER_LINGER_SECONDS` from the same configured `consoleproxy.session.timeout` value (`ConsoleProxy.sessionTimeoutMillis`) instead of keeping it as an independent hardcoded constant, so all console viewer types (noVNC, VNC, RDP, AJAX) honour one single, consistently-configured idle timeout.

This was flagged during review of PR #13058 (https://github.com/apache/cloudstack/pull/13058#discussion_r3309508273) but deliberately left out of that PR's scope, since it's a noVNC-focused backport and touching `isFrontEndAlive()` for the legacy viewer types is a broader behavioural change that deserves its own review/testing pass.

貢獻指南

開啟貢獻指南

研究方向

先閱讀 ConsoleProxyVncClient、ConsoleProxyRdpClient 和 ConsoleProxyNoVncClient 中的 ConsoleProxy.VIEWER_LINGER_SECONDS、ConsoleProxy.sessionTimeoutMillis 及 isFrontEndAlive()。將 consoleproxy.session.timeout 設定為高於 180000 ms 以重現問題,然後確認 legacy VNC、RDP、AJAX 和 noVNC 工作階段是否都使用設定的閒置逾時,而不是另外的 180 秒門檻。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
backend
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
描述清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。