[X2Go-Commits] python-x2go.git - release/0.4.0.x (branch) updated: 0.2.1.0-9-g453d11e

X2Go dev team git-admin at x2go.org
Tue Jan 7 16:18:24 CET 2014


The branch, release/0.4.0.x has been updated
       via  453d11e530cc18fe7d88598bad7bbb13fc1cc6f2 (commit)
      from  6efedf038a16505e6cd6c20656b5b9c688da3d6a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                 |    1 +
 x2go/backends/control/_stdout.py |   12 ++++++++++++
 x2go/cache.py                    |    8 +++++---
 3 files changed, 18 insertions(+), 3 deletions(-)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 36e4a9a..5559148 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,7 @@ python-x2go (0.2.1.1-0~x2go1) UNRELEASED; urgency=low
       under the same user ID, we have to strictly differentiate between
       running/suspend sessions associated to the several connected session
       profiles.
+    - Make connection disruptures more robust.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Thu, 13 Dec 2012 13:32:30 +0100
 
diff --git a/x2go/backends/control/_stdout.py b/x2go/backends/control/_stdout.py
index 7e29166..fdb80d4 100644
--- a/x2go/backends/control/_stdout.py
+++ b/x2go/backends/control/_stdout.py
@@ -798,6 +798,9 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
                         if str(e) == 'No authentication methods available':
                             raise paramiko.AuthenticationException('Interactive password authentication required!')
                         else:
+                            self.close()
+                            if self.sshproxy_session:
+                                self.sshproxy_session.stop_thread()
                             raise(e)
 
                 # since Paramiko 1.7.7.1 there is compression available, let's use it if present...
@@ -872,9 +875,16 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
                     self.logger('Requesting SSH agent forwarding for control session of connected session profile %s' % self.profile_name, loglevel=log.loglevel_INFO)
                 else:
                     self.logger('SSH agent forwarding is not available in the Paramiko version used with this instance of Python X2Go', loglevel=log.loglevel_WARN)
+        else:
+            self.close()
+            if self.sshproxy_session:
+                self.sshproxy_session.stop_thread()
 
         self._remote_home = None
         if not self.home_exists():
+            self.close()
+            if self.sshproxy_session:
+                self.sshproxy_session.stop_thread()
             raise x2go_exceptions.X2goRemoteHomeException('remote home directory does not exist')
 
         return (self.get_transport() is not None)
@@ -979,6 +989,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
                 return True
         except x2go_exceptions.X2goControlSessionException:
             self.session_died = True
+            self.disconnect()
         return False
 
     def has_session_died(self):
@@ -1438,6 +1449,7 @@ class X2goControlSessionSTDOUT(paramiko.SSHClient):
 
             if _count >= _maxwait:
                 self.session_died = True
+                self.disconnect()
                 raise x2go_exceptions.X2goControlSessionException('x2golistsessions command failed after we have tried 20 times')
 
             # update internal variables when list_sessions() is called
diff --git a/x2go/cache.py b/x2go/cache.py
index f0063d7..1654e08 100644
--- a/x2go/cache.py
+++ b/x2go/cache.py
@@ -152,7 +152,8 @@ class X2goListSessionsCache(object):
             self.x2go_listsessions_cache[profile_name]['mounts'] = {}
             if self.x2go_listsessions_cache[profile_name]['sessions']:
                 for session_name in self.x2go_listsessions_cache[profile_name]['sessions']:
-                    self.x2go_listsessions_cache[profile_name]['mounts'].update(control_session.list_mounts(session_name))
+                    if control_session is not None and not control_session.has_session_died():
+                        self.x2go_listsessions_cache[profile_name]['mounts'].update(control_session.list_mounts(session_name))
         except (x2go_exceptions.X2goControlSessionException, AttributeError), e:
             if profile_name in self.x2go_listsessions_cache.keys():
                 del self.x2go_listsessions_cache[profile_name]
@@ -173,7 +174,8 @@ class X2goListSessionsCache(object):
         @raise X2goControlSessionException: if the control session's C{list_desktop} method fails
         """
         try:
-            self.x2go_listsessions_cache[profile_name]['desktops'] = control_session.list_desktops()
+            if control_session is not None and not control_session.has_session_died():
+                self.x2go_listsessions_cache[profile_name]['desktops'] = control_session.list_desktops()
         except (x2go_exceptions.X2goControlSessionException, AttributeError), e:
             if profile_name in self.x2go_listsessions_cache.keys():
                 del self.x2go_listsessions_cache[profile_name]
@@ -192,7 +194,7 @@ class X2goListSessionsCache(object):
         @raise X2goControlSessionException: if the control session's C{list_sessions} method fails
         """
         try:
-            if control_session is not None:
+            if control_session is not None and not control_session.has_session_died():
                 self.x2go_listsessions_cache[profile_name]['sessions'] = control_session.list_sessions()
         except (x2go_exceptions.X2goControlSessionException, AttributeError), e:
             if profile_name in self.x2go_listsessions_cache.keys():


hooks/post-receive
-- 
python-x2go.git (Python X2Go Client API)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-x2go.git" (Python X2Go Client API).




More information about the x2go-commits mailing list