[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:38:47 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8a0f1e7acd0cb594d36f3d359e3f4101d307b04a
Author: ossy at webkit.org <ossy at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Nov 9 22:29:28 2010 +0000

    2010-11-09  Sheriff Bot  <webkit.review.bot at gmail.com>
    
            Unreviewed, rolling out r71672.
            http://trac.webkit.org/changeset/71672
            https://bugs.webkit.org/show_bug.cgi?id=49276
    
            It doesn't work on Chromium Windows bot (Requested by Ossy on
            #webkit).
    
            * Scripts/webkitpy/common/system/file_lock.py: Removed.
            * Scripts/webkitpy/common/system/file_lock_unittest.py: Removed.
            * Scripts/webkitpy/layout_tests/port/http_lock.py:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71679 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 404f071..7d3867e 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-09  Sheriff Bot  <webkit.review.bot at gmail.com>
+
+        Unreviewed, rolling out r71672.
+        http://trac.webkit.org/changeset/71672
+        https://bugs.webkit.org/show_bug.cgi?id=49276
+
+        It doesn't work on Chromium Windows bot (Requested by Ossy on
+        #webkit).
+
+        * Scripts/webkitpy/common/system/file_lock.py: Removed.
+        * Scripts/webkitpy/common/system/file_lock_unittest.py: Removed.
+        * Scripts/webkitpy/layout_tests/port/http_lock.py:
+
 2010-11-09  Gabor Rapcsanyi  <rgabor at inf.u-szeged.hu>
 
         Reviewed by Tony Chang.
diff --git a/WebKitTools/Scripts/webkitpy/common/system/file_lock.py b/WebKitTools/Scripts/webkitpy/common/system/file_lock.py
deleted file mode 100644
index 09d03b8..0000000
--- a/WebKitTools/Scripts/webkitpy/common/system/file_lock.py
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Gabor Rapcsanyi (rgabor at inf.u-szeged.hu), University of Szeged
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""This class helps to lock files exclusively across processes."""
-
-import os
-import sys
-
-
-class FileLock(object):
-
-    def __init__(self, lock_file_path):
-        self._lock_file_path = lock_file_path
-        self._lock_file_descriptor = None
-
-    def acquire_lock(self):
-        self._lock_file_descriptor = os.open(self._lock_file_path, os.O_CREAT)
-        if sys.platform in ('darwin', 'linux2', 'cygwin'):
-            import fcntl
-            lock_flags = fcntl.LOCK_EX | fcntl.LOCK_NB
-            fcntl.flock(self._lock_file_descriptor, lock_flags)
-        elif sys.platform == 'win32':
-            import msvcrt
-            lock_flags = msvcrt.LK_NBLCK
-            msvcrt.locking(self._lock_file_descriptor, lock_flags, 32)
-
-    def release_lock(self):
-        if self._lock_file_descriptor:
-            os.close(self._lock_file_descriptor)
-            os.unlink(self._lock_file_path)
diff --git a/WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py b/WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py
deleted file mode 100644
index 8fb8a82..0000000
--- a/WebKitTools/Scripts/webkitpy/common/system/file_lock_unittest.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-# Copyright (C) 2010 Gabor Rapcsanyi (rgabor at inf.u-szeged.hu), University of Szeged
-#
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY UNIVERSITY OF SZEGED ``AS IS'' AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL UNIVERSITY OF SZEGED OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
-# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import tempfile
-import unittest
-
-from webkitpy.common.system.file_lock import FileLock
-
-
-class FileLockTest(unittest.TestCase):
-
-    def setUp(self):
-        self._lock_name = "TestWebKit" + str(os.getpid()) + ".lock"
-        self._lock_path = os.path.join(tempfile.gettempdir(), self._lock_name)
-        self._file_lock = FileLock(self._lock_path)
-
-    def tearDown(self):
-        if os.path.exists(self._lock_path):
-            os.unlink(self._lock_path)
-
-    def test_lock_lifecycle(self):
-        # Create the lock.
-        self._file_lock.acquire_lock()
-        self.assertTrue(os.path.exists(self._lock_path))
-
-        # Try to lock again.
-        self.assertRaises((OSError, IOError), self._file_lock.acquire_lock)
-
-        # Release the lock.
-        self._file_lock.release_lock()
-        self.assertFalse(os.path.exists(self._lock_path))
-
-    def test_stuck_lock(self):
-        open(self._lock_path, 'w').close()
-        self._file_lock.acquire_lock()
-        self._file_lock.release_lock()
diff --git a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
index 41d56b4..d65801d 100644
--- a/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
+++ b/WebKitTools/Scripts/webkitpy/layout_tests/port/http_lock.py
@@ -36,7 +36,6 @@ import tempfile
 import time
 
 from webkitpy.common.system.executive import Executive
-from webkitpy.common.system.file_lock import FileLock
 
 
 _log = logging.getLogger("webkitpy.layout_tests.port.http_lock")
@@ -53,7 +52,6 @@ class HttpLock(object):
         self._lock_file_path_prefix = os.path.join(self._lock_path,
                                                    self._lock_file_prefix)
         self._guard_lock_file = os.path.join(self._lock_path, guard_lock)
-        self._guard_lock = FileLock(self._guard_lock_file)
         self._process_lock_file_name = ""
         self._executive = Executive()
         # maximum wait time for the lock creation
@@ -97,7 +95,7 @@ class HttpLock(object):
                 _log.debug("Removing stuck lock file: %s" % lock_list[0])
                 os.unlink(lock_list[0])
                 return
-        except (IOError, OSError):
+        except IOError, OSError:
             return
         return int(current_pid)
 
@@ -112,16 +110,17 @@ class HttpLock(object):
         start_time = time.time()
         while(True):
             try:
-                self._guard_lock.acquire_lock()
+                sequential_guard_lock = os.open(self._guard_lock_file, os.O_CREAT | os.O_EXCL)
                 self._process_lock_file_name = (self._lock_file_path_prefix +
                                                 str(self._next_lock_number()))
                 lock_file = open(self._process_lock_file_name, 'w')
                 _log.debug("Creating lock file: %s" % self._process_lock_file_name)
                 lock_file.write(str(os.getpid()))
                 lock_file.close()
-                self._guard_lock.release_lock()
+                os.close(sequential_guard_lock)
+                os.unlink(self._guard_lock_file)
                 return True
-            except (IOError, OSError):
+            except OSError:
                 if time.time() - start_time > self._guard_lock_max_wait:
                     _log.debug("Lock does not created: %s" % str(sys.exc_info()))
                     return False

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list