[X2Go-Commits] python-x2go.git - twofactorauth (branch) updated: 0.4.0.7-4-gb435cdc

X2Go dev team git-admin at x2go.org
Sat Sep 14 15:58:07 CEST 2013


The branch, twofactorauth has been updated
       via  b435cdc1d7980d8dec33f1e05cb3947ecf08dd07 (commit)
      from  81c41bdee16b575584f158c4a27893adfeb371c4 (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 |    2 ++
 x2go/registry.py |    3 +++
 x2go/session.py  |   13 +++++++++++++
 3 files changed, 18 insertions(+)

The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 9f930ea..8f78fb2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ python-x2go (0.4.0.8-0~x2go1) UNRELEASED; urgency=low
 
   * New upstream version (0.4.0.8):
     - Fix session profile updates with changes to the host parameter.
+    - Use the session object's lock to detect if updating the session
+      status in the session registry is something appropriate to do.
 
  -- Mike Gabriel <mike.gabriel at das-netzwerkteam.de>  Sat, 03 Aug 2013 22:32:30 +0200
 
diff --git a/x2go/registry.py b/x2go/registry.py
index 2bd2d14..0b46661 100644
--- a/x2go/registry.py
+++ b/x2go/registry.py
@@ -271,6 +271,9 @@ class X2GoSessionRegistry(object):
             if type(self(_session_uuid)) != session.X2GoSession:
                 continue
 
+            if self(_session_uuid).is_locked():
+                continue
+
             if not self(_session_uuid).update_status(session_list=session_list, force_update=force_update):
                 # skip this run, as nothing has changed since the last time...
                 continue
diff --git a/x2go/session.py b/x2go/session.py
index 6302363..237e84b 100644
--- a/x2go/session.py
+++ b/x2go/session.py
@@ -1799,7 +1799,9 @@ class X2GoSession(object):
                     self._progress_status = 10
                     progress_event.set()
 
+                    self._lock.release()
                     gevent.sleep(5)
+                    self._lock.acquire()
 
                     self._progress_status = 15
                     progress_event.set()
@@ -2754,3 +2756,14 @@ class X2GoSession(object):
         self.terminal_session = None
     __session_cleanup = session_cleanup
 
+    def is_locked(self):
+        """\
+        Test if the session is lock at the moment. This normally occurs
+        if there is some action running that will result in a session status
+        change.
+
+        @return: returns C{True} if the session is locked
+        @rtype: C{bool}
+
+        """
+        self._lock.locked()


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