Backport: Honour consoleproxy.session.timeout for noVNC console sessions - #13058
dheeraj12347 wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to backport the fix to ensure consoleproxy.session.timeout is honored for noVNC console sessions on the 4.20 branch, so idle sessions are cleaned up and don’t linger indefinitely.
Changes:
- Updates the noVNC WebSocket handler with additional logging, parameter validation, and safer frame/error handling.
- Refactors the console proxy GC thread loop and related logging around idle session cleanup.
- Adjusts console proxy startup/authentication reflection and noVNC viewer creation/replacement logic.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyNoVNCHandler.java | WebSocket connect/frame/error handling changes intended to support correct idle-session cleanup. |
| services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxyGCThread.java | GC loop refactor and idle session timeout constant/comment updates. |
| services/console-proxy/server/src/main/java/com/cloud/consoleproxy/ConsoleProxy.java | Console proxy startup/auth reflection changes and noVNC viewer lifecycle adjustments. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #13058 +/- ##
============================================
- Coverage 16.26% 16.26% -0.01%
- Complexity 13434 13435 +1
============================================
Files 5667 5667
Lines 500731 500762 +31
Branches 60803 60817 +14
============================================
- Hits 81455 81436 -19
- Misses 410172 410230 +58
+ Partials 9104 9096 -8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the detailed review and suggestions from Copilot. |
|
@dheeraj12347 , I set consoleproxy.session.timeout to 30000, expecting my consoles to get lost in half a minute. I restarted the MS. The consoles keep working until about the half an hour, the default setting. (I didn’t measure exactly) Can you have another look at this? |
|
@dheeraj12347 once this is merged into 4.20, it will be included in main as well after forward-merge |
Hi @DaanHoogland , I’ve updated the PR to address the consoleproxy.session.timeout behaviour you described: In ConsoleProxy.java I now read consoleproxy.session.timeout from the configuration (milliseconds), validate it, and store the effective value in ConsoleProxy.sessionTimeoutMillis, with a log line on startup showing the effective timeout. In ConsoleProxyGCThread.java I removed the hardcoded idle timeout and changed the GC logic to compute each viewer’s idle time in milliseconds and compare it against ConsoleProxy.sessionTimeoutMillis, logging the idle duration and configured timeout when a session is removed. To verify my changes, I built the console proxy server module with: bash I’m open to any feedback on this approach, and I’m happy to further adjust or iterate based on your results when you re-test with consoleproxy.session.timeout=30000. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18836 |
Pearl1594
left a comment
There was a problem hiding this comment.
code lgtm. Lot of newlines added, not sure if they are necessary.
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
Co-authored-by: dahn <daan.hoogland@gmail.com>
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18869 |
|
[SF] Trillian test result (tid-16769)
|
kiranchavala
left a comment
There was a problem hiding this comment.
I see the new setting is not taking affect
cmk update configuration name=consoleproxy.session.timeout value=60000
cmk list configurations name=consoleproxy.session.timeout filter=name,value
cmk destroy systemvm id= # or stop/start to force a fresh boot
root@v-6-VM:~# 2026-09-16T05:16:56,104 INFO [cloud.consoleproxy.ConsoleProxy] (Console-Proxy-Main:[]) Effective consoleproxy.session.timeout=300000 ms
|
@dheeraj12347 are you still looking at this? |
|
@dheeraj12347 : a ai generated comment to this change:
I think we (as in you ;) ) should add this to this PR. |
|
Thanks @DaanHoogland, I added the missing propagation of consoleproxy.session.timeout to the CPVM boot arguments in ConsoleProxyManagerImpl, as suggested. |
|
@blueorangutan package |
|
@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19399 |
|
@blueorangutan test keepEnv |
|
@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
Description
This PR backports the console proxy/noVNC timeout fix to the 4.20 branch.
It ensures that
consoleproxy.session.timeoutis honoured for noVNC consolesessions, so idle sessions are cleaned up correctly and do not linger
indefinitely.
Key points:
consoleproxy.session.timeoutthrough the console proxy server fornoVNC-based console sessions.
are closed after the configured period.
newer
sessionRequiresNewViewerAPI onConsoleProxyClientParam, onlyremove the references that exist in later branches.
Related work
idle noVNC sessions not respecting
consoleproxy.session.timeout.Testing
Compiled the console proxy server module successfully:
Verified that the code builds cleanly with checkstyle on the 4.20 branch.
Fix Global setting "consoleproxy.session.timeout " is not honoured #12810