[Webkit-unassigned] [Bug 64886] new-run-webkit-tests hung while acquiring http lock on snow leopard bots

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 20 13:10:36 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=64886





--- Comment #1 from Eric Seidel <eric at webkit.org>  2011-07-20 13:10:36 PST ---
I don't think our filelock code is correct.

    def acquire_lock(self):
        self._lock_file_descriptor = os.open(self._lock_file_path, os.O_TRUNC | os.O_CREAT)
        start_time = time.time()
        while True:
            try:
                self._create_lock()
                return True
            except IOError:
                if time.time() - start_time > self._max_wait_time_sec:
                    _log.debug("File locking failed: %s" % str(sys.exc_info()))
                    os.close(self._lock_file_descriptor)
                    self._lock_file_descriptor = None
                    return False

Notice how we're calling os.open, with trunc/create *OUTSIDE* of any lock.

I think we should be opening with "append" or some non-harmful mode, since it's very easy for two processes to try and grab the same lock, and blast away each other's lock just by opening the file, no?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list