Bug 5197 - seamlessrdp sessions no longer terminate with programs
Summary: seamlessrdp sessions no longer terminate with programs
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: | rdesktop (deprecated) (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.3.0
Assignee: Henrik Andersson
URL:
Keywords: prosaic, samuel_tester
Depends on:
Blocks:
 
Reported: 2014-06-25 16:52 CEST by Pierre Ossman
Modified: 2014-10-08 17:47 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:


Attachments

Description Pierre Ossman cendio 2014-06-25 16:52:08 CEST
This is a regression caused by bug 4499.

A seamlesrdp session will no longer terminate when every program in the session has died. This was the desired effect for the use case in bug 4499, but not desired when you give a command to rdesktop at the same time.

To fix this we need to make rdesktop tell seamlessrdpshell which mode it should be in, and have it change its termination logic accordingly.

Be mindful of races when fixing this. We don't want seamlessrdpshell exiting right away because the process wasn't started fast enough, or failing to terminate because the process died before we could set the proper mode.
Comment 2 Henrik Andersson cendio 2014-07-03 12:43:48 CEST
Committed upstream:

seamlessrdp - r1821
rdesktop - r1822
Comment 3 Henrik Andersson cendio 2014-07-03 12:51:16 CEST
(In reply to comment #2)
> Committed upstream:
> 
> seamlessrdp - r1821
> rdesktop - r1822

Missed to describe what changes are made and the test cases that was tests.

The seamless rdp protocol is extended with a new command, PERSISTENT which is used to change the persistent mode of the seamless rdp session.

  PERSISTENT
  ----------

  Change persistent mode for the session.

  Syntax:
  	  PERSISTENT,<SERIAL>,<ENABLE>

  A seamless session always starts in persistent mode. This means that
  the session will not terminate if all applications is closed. 
  Upon re-connection to a session, the session will reset to persistent
  mode and client needs to change this if non persistent mode is wanted.
  If a persistent session not have any application running and is in
  disconnected state, it will terminate after a timeout is reached that
  matches the lifetime of the re-connection cookie.

Commit r1821 implements the new command and logics around it. This does not change the current behavior of seamless rdp where all sessions are persistent.

Commit r1820 implements the use of persistent mode changing, if a seamless command is specified as argument, a non-persistent mode will be used, eg. the seamless session will terminate when closing the spawned seamless command.
If no command is specified as argument the session will be persistent, and the only time it will end is when a timeout is reached during the session is in disconnected state.
Comment 4 Henrik Andersson cendio 2014-07-03 13:03:25 CEST
The following tests has been performed against Windows 2008r2 server.

Test: Persistent session
------------------------
1. Connect without seamless command, starts a persistent session
2. Connect with seamless command, will make rdesktop enter slave mode
   and send spawn command trough the current connection.
3. Closing application and verified that the session still is alive
4. Disconnected the original connection and verified that the session
   was terminated after the timeout.

Test: Change persistent into non-persistent
-------------------------------------------
1. Connect without seamless command, starts a persistent session
2. Connect with seamless command, rdesktop in slave mode sends spawn command 
   trough the master connection.
3. Closing application and verified that the session still is alive
4. Disconnected the original connection.
5. Before timeout i reconnected to the session using a seamless command and   
   verified that the session changed mode to non-persistent.

Test: Change non-persistent session into persistent
---------------------------------------------------
1. Connect with seamless command, starts a non-persistent session
2. Disconnect from the session and verified it wouldn't timeout as
   a persistent session would.
3. Reconnected to session but without seamless command and verified that
   the session changed persistent mode to non-persistent.
Comment 5 Henrik Andersson cendio 2014-07-03 13:14:03 CEST
seamlesrdp updated with vendordrop in commit 29162.
rdesktop updated with vendordrop in commit 29165.
Comment 6 Samuel Mannehed cendio 2014-10-08 17:47:23 CEST
* ran: tl-run-winapp-seamless -G 2008r2 "wmplayer.exe"
* used the application and then clicked the X to close it
* rdesktop processes were terminated on the linux server and the all the test-user was logged of from the windows server

Works as intended on windows 2008 r2. Verified with build 4506.

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