Skip to content

novnc: Accept new novnc client and disconnect old session#4531

Merged
yadvr merged 2 commits into
apache:4.15from
ustcweizhou:4.15-novnc-session-issue
Mar 6, 2021
Merged

novnc: Accept new novnc client and disconnect old session#4531
yadvr merged 2 commits into
apache:4.15from
ustcweizhou:4.15-novnc-session-issue

Conversation

@ustcweizhou
Copy link
Copy Markdown
Contributor

@ustcweizhou ustcweizhou commented Dec 10, 2020

Description

Fixes #4550
This PR fixes an issue with novnc.

  1. open a vm console
  2. open the console in another session (other server, or different browser, or incognito window)
    console will be stuck at Connecting
  3. reload the page, vm console works. The console in step (1) is kicked out.

image

with this PR, the console in new session will work, the old session will be disconnected.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

with this pr, in new windows

image

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Dec 10, 2020

Shouldn't new console kick the old one out?

@yadvr yadvr self-requested a review December 10, 2020 19:11
@weizhouapache
Copy link
Copy Markdown
Member

Shouldn't new console kick the old one out?

@rhtyd in old ajax viewer, no

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Dec 11, 2020

@ustcweizhou I think for the new novnc console, opening new window/session should close the previous on.
@davidjumani can you review ?

@yadvr yadvr requested a review from davidjumani December 11, 2020 12:41
@weizhouapache
Copy link
Copy Markdown
Member

@ustcweizhou I think for the new novnc console, opening new window/session should close the previous on.
@davidjumani can you review ?

@rhtyd
there are 3 options
(1) reject new session, and keep old session.
(2) accept new session, and kick out old session
(3) keep both sessions

The current behavior (reject the first new session and accept the second new session) seems to be bug.

we have (3) in our production but the implementation is different from master.
we think (1) is better than (2).

@davidjumani @DaanHoogland @PaulAngus @andrijapanicsb your opinion ?

@davidjumani
Copy link
Copy Markdown
Contributor

davidjumani commented Dec 11, 2020

@rhtyd @weizhouapache Keeping both sessions should not be possible since an exclusive flag is sent when viewing the console
I'm for (1) - Reject the new and keep the old (just shorten the idle timeout)

@davidjumani
Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@davidjumani a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2481

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Dec 11, 2020

Last time I tried to do a remote vnd - if you try to connect, it usually bounces off older/other consoles and grants the new one to be opened. What's the behaviour in old console proxy? I think if we're rejecting the new console then a suitable msg but be shown.

@DaanHoogland
Copy link
Copy Markdown
Contributor

without any extra €0.02, option 1 has my vote but rohit's remark is valid, something like "concole session active" should do. we don't have to be verbose.

@andrijapanic-dont-use-this-one
Copy link
Copy Markdown

Old VNC console is to kick out the previous session.

If we do the opposite, at very least a proper message should be shown to user, while making sure that an old session is terminated after some inactivity period, otherwise a colleague helping another colleague would not be able to take over the console session, which impacts usability.

I'm personally for the old behaviour - kick off the old session (with a message explaining that another session has been established elsewhere) and allow the new session - it simply makes more sense and is more user-friendly.

@andrijapanicsb
Copy link
Copy Markdown
Contributor

um, that was me above ^^^

@weizhouapache
Copy link
Copy Markdown
Member

it looks difficult to get an decision.
would it be better to add global setting and let users choose ?

@andrijapanicsb
Copy link
Copy Markdown
Contributor

+1, with perhaps defaulting to the old VNC console behaviour (which should have been implemented in the first place)

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Dec 12, 2020

Agree, I would prefer the original behaviour; new console should kick the old one out.

@davidjumani
Copy link
Copy Markdown
Contributor

New console should not be created if an existing one is open. Kicking out the old session will cause issues especially when there are multiple users trying to access the console

@andrijapanicsb
Copy link
Copy Markdown
Contributor

That is how it worked so far @davidjumani and it allows colleagues who are jointly (remotely distanced people) troubleshooting a thing.

We all need to observe things from the user and usability perspective.

@shwstppr
Copy link
Copy Markdown
Contributor

Do we have a consensus on this? Can we have new global setting to switch between new session kicking our ol session and new session being rejected?

@DaanHoogland
Copy link
Copy Markdown
Contributor

@rhtyd
there are 3 options
(1) reject new session, and keep old session.
(2) accept new session, and kick out old session
(3) keep both sessions

The current behavior (reject the first new session and accept the second new session) seems to be bug.

I think given discussions here we should go for a tristate configuration option, letting the operator decide. Given that (2) is the old behaviour it should then be the default. agree?

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Jan 4, 2021

+1 makes sense, go with backward compatibility

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 12, 2021

ping @ustcweizhou can you make the changes? Or introduce a global setting to toggle behaviour?

@weizhouapache
Copy link
Copy Markdown
Member

ping @ustcweizhou can you make the changes? Or introduce a global setting to toggle behaviour?

@rhtyd I will work on it.

@weizhouapache
Copy link
Copy Markdown
Member

@rhtyd @DaanHoogland @davidjumani
as discussed, updated this pr to accept new vm console session and disconnect old session.

@weizhouapache weizhouapache changed the title novnc: Reject new novnc client if novnc viewer object is still alive novnc: Accept new novnc client and disconnect old session Feb 22, 2021
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 26, 2021

@blueorangutan package

@yadvr yadvr changed the base branch from master to 4.15 February 26, 2021 07:05
@yadvr yadvr modified the milestones: 4.16.0.0, 4.15.1.0 Feb 26, 2021
@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 26, 2021

@blueorangutan package

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.

@blueorangutan
Copy link
Copy Markdown

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2834

@yadvr
Copy link
Copy Markdown
Member

yadvr commented Feb 26, 2021

@blueorangutan test

@blueorangutan
Copy link
Copy Markdown

@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan
Copy link
Copy Markdown

Trillian test result (tid-3621)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 33816 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4531-t3621-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_ssvm.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
Smoke tests completed. 85 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_01_migrate_VM_and_root_volume Error 62.14 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 47.05 test_vm_life_cycle.py

Copy link
Copy Markdown
Contributor

@davidjumani davidjumani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like the old console. The old session is terminated when a new one is opened

@yadvr yadvr merged commit cdc3b08 into apache:4.15 Mar 6, 2021
@weizhouapache weizhouapache mentioned this pull request Mar 12, 2021
12 tasks
DaanHoogland pushed a commit to shapeblue/cloudstack that referenced this pull request May 20, 2022
* novnc: Reject new novnc client if novnc viewer object is still alive

* apache#4531 novnc: Accept new novnc client and disconnect old session
shwstppr pushed a commit to shapeblue/cloudstack that referenced this pull request Jan 17, 2023
* novnc: Reject new novnc client if novnc viewer object is still alive

* apache#4531 novnc: Accept new novnc client and disconnect old session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential security issue with novnc console

9 participants