Skip to content

Console proxy threads spin at 100% CPU in NoVncClient.waitForNoVNCReply() when noVNC never replies #14538

Open

Description

@MitchDrage

problem

Console sessions opened while the target VM was being restarted get stuck in waitForNoVNCReply().
I found that the method is while (isWaitForNoVnc()) { cycles++; }, and it doesn't include a sleep or timeout, and doesn't consult the websocket or VNC socket to confirm that it's still required.

I found that qemu had already closed the VNC socket (CLOSE-WAIT on the CPVM side).
Restarting the cloud service in the CPVM cleared the issue.

As you'll note, the chance of this occurring is quite low as it requires specific timing, but these threads never clear so on busy environments this could start to tie up CPU cycles leading to console slowdown until an eventual CPVM crash.

versions

4.22.1.1

The steps to reproduce the bug

  1. Open the console of a running KVM instance from the UI.
  2. Stop, start or reboot the instance (or its host) while the console is connecting.
  3. Watch top -H inside the CPVM.

What to do about it?

waitForNoVNCReply() needs a short sleep and a timeout, and should give up once the session or socket is closed.

Activity

  1. Daniel-Pereira-Linux commented on Oct 30, 2026

    @Daniel-Pereira-Linux

    Hi, I had also noticed this problem. I've been working on a fix for a few days, and the unit tests I wrote for it pass. I'll probably open a PR with the fix if the CloudStack team agrees the change is needed.

  2. added a commit that references this issue on Oct 30, 2026
    40d527c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy