[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

ossy at webkit.org ossy at webkit.org
Wed Dec 22 15:34:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4d80ac615e3845658699cd303c0100dce5b6995d
Author: ossy at webkit.org <ossy at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Nov 8 16:25:20 2010 +0000

    2010-11-08  Gabor Rapcsanyi  <rgabor at inf.u-szeged.hu>
    
            Reviewed by Csaba Osztrogonác.
    
            [NRWT] If the http lock fails we shouldn't do any locking
            https://bugs.webkit.org/show_bug.cgi?id=49164
    
            If something goes wrong with the locking, the test should keep going.
    
            * Scripts/webkitpy/layout_tests/port/http_lock.py:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71525 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index b9b0503..50e4cd2 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2010-11-08  Gabor Rapcsanyi  <rgabor at inf.u-szeged.hu>
+
+        Reviewed by Csaba Osztrogonác.
+
+        [NRWT] If the http lock fails we shouldn't do any locking
+        https://bugs.webkit.org/show_bug.cgi?id=49164
+
+        If something goes wrong with the locking, the test should keep going.
+
+        * Scripts/webkitpy/layout_tests/port/http_lock.py:
+
 2010-11-08  Adam Roben  <aroben at apple.com>
 
         Switch back to using kCGImageAlphaPremultipliedFirst when generating
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
index 08dca1f..d65801d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
@@ -45,7 +45,8 @@ class HttpLock(object):
 
     def __init__(self, lock_path, lock_file_prefix="WebKitHttpd.lock.",
                  guard_lock="WebKit.lock"):
-        if not lock_path:
+        self._lock_path = lock_path
+        if not self._lock_path:
             self._lock_path = tempfile.gettempdir()
         self._lock_file_prefix = lock_file_prefix
         self._lock_file_path_prefix = os.path.join(self._lock_path,
@@ -53,6 +54,8 @@ class HttpLock(object):
         self._guard_lock_file = os.path.join(self._lock_path, guard_lock)
         self._process_lock_file_name = ""
         self._executive = Executive()
+        # maximum wait time for the lock creation
+        self._guard_lock_max_wait = 1 * 60
 
     def cleanup_http_lock(self):
         """Delete the lock file if exists."""
@@ -100,6 +103,11 @@ class HttpLock(object):
         """The lock files are used to schedule the running test sessions in first
         come first served order. The sequential guard lock ensures that the lock
         numbers are sequential."""
+        if not os.path.exists(self._lock_path):
+            _log.debug("Lock directory does not exist: %s" % self._lock_path)
+            return False
+
+        start_time = time.time()
         while(True):
             try:
                 sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_EXCL)
@@ -111,12 +119,18 @@ class HttpLock(object):
                 lock_file.close()
                 os.close(sequential_guard_lock)
                 os.unlink(self._guard_lock_file)
-                break
+                return True
             except OSError:
-                pass
+                if time.time() - start_time > self._guard_lock_max_wait:
+                    _log.debug("Lock does not created: %s" % str(sys.exc_info()))
+                    return False
 
     def wait_for_httpd_lock(self):
-        """Create a lock file and wait until it's turn comes."""
-        self._create_lock_file()
+        """Create a lock file and wait until it's turn comes. If something goes wrong
+        it wont do any locking."""
+        if not self._create_lock_file():
+            _log.debug("Warning, http locking failed!")
+            return
+
         while self._curent_lock_pid() != os.getpid():
             time.sleep(1)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list