Bug 7630 - VSM Server still uses Python 2
Summary: VSM Server still uses Python 2
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VSM Server (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.13.0
Assignee: Frida Flodin
URL:
Keywords: prosaic
Depends on:
Blocks: 7572
  Show dependency treegraph
 
Reported: 2021-01-22 12:47 CET by Linn
Modified: 2021-07-22 12:35 CEST (History)
2 users (show)

See Also:
Acceptance Criteria:


Attachments

Description Linn cendio 2021-01-22 12:47:02 CET
It needs to be converted to work with Python 3.
Comment 1 Linn cendio 2021-01-22 12:59:57 CET
Here is a list of shared dependencies between VSM Server and VSM Agent (bug 7629):

* vsm.xmlrpc
* ctcommon
* vsm.vsmcommon
* vsm.extproc
* vsm.async
* which
* vsm.authoritychecker
* vsm.check_environment
Comment 21 Frida Flodin cendio 2021-02-10 08:03:33 CET
Commit r36123 was accidentally sent without a finished commit message. Here is what is should have said:

------------------------------------------------------------------------
r36123 | frifl | trunk/ctc/vsm/

Move out VSM handlers from vsmcommon

It is more clear to have the handlers in their own module.

Done as part of bug 7629 and bug 7630.
------------------------------------------------------------------------
Comment 60 William Sjöblom cendio 2021-02-23 10:25:21 CET
Clarification to r36213:

Functionally tested by verifying that sessions are successfully removed when upon starting a session, killing the agent and waiting for the master to invoke the periodic session verification.
Comment 92 Frida Flodin cendio 2021-03-05 10:27:17 CET
Crypto
------
The crypto module is now converted to support Python 3. I have tested that the
following still works as expected:

 * tl-ldap-certalias (CentOS 7)
 * Loading and verifying licenses (RHEL 8)
 * sso (RHEL 8)
Comment 109 Frida Flodin cendio 2021-03-10 08:13:59 CET
Licensehandler
--------------
Licensehandler can now support Python 3. I have tested that the following still
work with Python 2 on Ubuntu20.04:

 * Valid licenses
 * Invalid licenses (too old TL version)
 * Admin warning mail with non-ASCII characters in customer name.
 * Warning when hitting soft limit
 * Not allowing more sessions when hitting hard limit
 * License graph in tlwebadm
 * tl-show-licenses
Comment 125 Frida Flodin cendio 2021-03-15 08:37:57 CET
Login handlers 
--------------
(handler_newsession, handler_shadowsession, handler_reconnectsession)

The login handlers now support Python 3. I tested that the following still works with Python 2 on RHEL 8:

* Creating new session
* Reconnecting to session
* Shadow session
Comment 140 Frida Flodin cendio 2021-03-17 09:15:03 CET
LoadBalancer
------------

The loadbalancer now support Python 3. Some changes was made to implementation of  the sorting of prioritized agents. Also, now the sorting of agents that a user has sessions on is more correct than before, the user should get new session on the best agent. This is a corner case since it requires multiple sessions and that the user has these session spread out on multiple agents. This should not happen in the normal case. 

I have tested that the following still works: 
- User gets new session on the agent with highest rating.

- With multiple sessions user gets new sessions on the same
  agent independent of rating.

- With multiple sessions user gets new session on another agent
  if the user's agent is down. But first the agent that is 
  marked as down is tested to see if it is really down.

- User with two sessions on two different agents, wanting to 
  created a third the one of the user's agents with the
  highest rating is chosen.

- User has session on agent that has been removed from the 
configuration. If the user wants new session it is created on another agent and there is a warning in the vsmserver log about this.

- Tlwebadm page for load info works fine (Status -> Load).
Comment 159 William Sjöblom cendio 2021-03-22 11:23:22 CET
UserSocket
----------

usersocketserverchannel, usersocketserver, and handler_createusersocket
now supports python 3.

After conversion, the following functionality has been tested:
- Creation and removal of unix domain socket in `/var/run/thinlinc/master/'
- Startup of a new session
- Reconnecting to a pre-existing session
- Shadowing
Comment 226 Pierre Ossman cendio 2021-04-07 14:54:37 CEST
Getting resource warnings for the main socket:

> sys:1: ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 9000)>

And for user sockets:

> sys:1: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=/var/run/thinlinc/master/0>
Comment 231 Pierre Ossman cendio 2021-04-08 10:31:28 CEST
The resource warning for the listening socket should now be fixed. Unfortunately I could not reproduce the warning for the user sockets, and I cannot see where in the code this might happen. Will have to wait for more information there.
Comment 232 Pierre Ossman cendio 2021-04-12 15:47:12 CEST
I'm getting this depracation warning on Ubuntu 20.04:

> $ sudo /opt/thinlinc/sbin/tl-show-licenses 
> /opt/thinlinc/modules/thinlinc/vsm/licensehandler.py:387: DeprecationWarning: This method will be removed in future versions.  Use 'parser.read_file()' instead.
>   I1iiIII1i . readfp ( iII11iI1i )
> License summary: 50 concurrent users. Hard limit of 55 concurrent users. 
> ThinLinc version: 4.12.1post
Comment 233 Pierre Ossman cendio 2021-04-12 17:05:47 CEST
This was apparently already noted in the code and will be fixed once we drop Python 2 compatibility from that module.

Note You need to log in before you can comment on or make changes to this bug.