2010-04-28 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Apr 2010 04:20:36 +0000 (04:20 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Apr 2010 04:20:36 +0000 (04:20 +0000)
        Reviewed by David Levin.

        Document that subprocess.poll/wait are not threadsafe
        https://bugs.webkit.org/show_bug.cgi?id=38289

        * Scripts/webkitpy/common/system/executive.py:
        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
        * Scripts/webkitpy/layout_tests/port/chromium.py:
        * Scripts/webkitpy/layout_tests/port/http_server.py:
        * Scripts/webkitpy/layout_tests/port/server_process.py:
        * Scripts/webkitpy/layout_tests/port/websocket_server.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58473 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/common/system/executive.py
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py
WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py
WebKitTools/Scripts/webkitpy/layout_tests/port/server_process.py
WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py

index a4a91f8..ed1e46f 100644 (file)
@@ -1,3 +1,17 @@
+2010-04-28  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by David Levin.
+
+        Document that subprocess.poll/wait are not threadsafe
+        https://bugs.webkit.org/show_bug.cgi?id=38289
+
+        * Scripts/webkitpy/common/system/executive.py:
+        * Scripts/webkitpy/layout_tests/layout_package/dump_render_tree_thread.py:
+        * Scripts/webkitpy/layout_tests/port/chromium.py:
+        * Scripts/webkitpy/layout_tests/port/http_server.py:
+        * Scripts/webkitpy/layout_tests/port/server_process.py:
+        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
+
 2010-04-28  Chris Jerdonek  <cjerdonek@webkit.org>
 
         Reviewed by Daniel Bates.
index 1a7e61e..11eb051 100644 (file)
@@ -108,6 +108,8 @@ class Executive(object):
         while True:
             output_line = child_process.stdout.readline()
             if output_line == "" and child_process.poll() != None:
+                # poll() is not threadsafe and can throw OSError due to:
+                # http://bugs.python.org/issue1731717
                 return child_process.poll()
             # We assume that the child process wrote to us in utf-8,
             # so no re-encoding is necessary before writing here.
@@ -249,6 +251,8 @@ class Executive(object):
         # run_command automatically decodes to unicode() unless explicitly told not to.
         if decode_output:
             output = output.decode("utf-8")
+        # wait() is not threadsafe and can throw OSError due to:
+        # http://bugs.python.org/issue1731717
         exit_code = process.wait()
 
         if return_exit_code:
index f86e15e..6957fcd 100644 (file)
@@ -447,6 +447,8 @@ class TestShellThread(threading.Thread):
         a separate DumpRenderTree in their own thread.
 
         """
+        # poll() is not threadsafe and can throw OSError due to:
+        # http://bugs.python.org/issue1731717
         if (not self._driver or self._driver.poll() is not None):
             self._driver = self._port.create_driver(self._image_path, self._shell_args)
             self._driver.start()
index 8b9149e..884d4f9 100644 (file)
@@ -201,6 +201,8 @@ class ChromiumPort(base.Port):
             _log.debug("Stopping layout test helper")
             self._helper.stdin.write("x\n")
             self._helper.stdin.close()
+            # wait() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             self._helper.wait()
 
     def test_base_platform_names(self):
@@ -306,6 +308,8 @@ class ChromiumDriver(base.Driver):
                                       close_fds=close_flag)
 
     def poll(self):
+        # poll() is not threadsafe and can throw OSError due to:
+        # http://bugs.python.org/issue1731717
         return self._proc.poll()
 
     def returncode(self):
@@ -400,8 +404,12 @@ class ChromiumDriver(base.Driver):
                 # force-kill the process if necessary.
                 KILL_TIMEOUT = 3.0
                 timeout = time.time() + KILL_TIMEOUT
+                # poll() is not threadsafe and can throw OSError due to:
+                # http://bugs.python.org/issue1731717
                 while self._proc.poll() is None and time.time() < timeout:
                     time.sleep(0.1)
+                # poll() is not threadsafe and can throw OSError due to:
+                # http://bugs.python.org/issue1731717
                 if self._proc.poll() is None:
                     _log.warning('stopping test driver timed out, '
                                  'killing it')
index 1479c61..fbe47e3 100755 (executable)
@@ -241,5 +241,7 @@ class Lighttpd(http_server_base.HttpServerBase):
         self._port_obj._shut_down_http_server(httpd_pid)
 
         if self._process:
+            # wait() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             self._process.wait()
             self._process = None
index cf4f4a2..62ca693 100644 (file)
@@ -104,6 +104,8 @@ class ServerProcess:
         """Check to see if the underlying process is running; returns None
         if it still is (wrapper around subprocess.poll)."""
         if self._proc:
+            # poll() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             return self._proc.poll()
         return None
 
@@ -168,6 +170,8 @@ class ServerProcess:
         select_fds = (out_fd, err_fd)
         deadline = time.time() + timeout
         while not self.timed_out and not self.crashed:
+            # poll() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             if self._proc.poll() != None:
                 self.crashed = True
                 self.handle_interrupt()
@@ -214,8 +218,12 @@ class ServerProcess:
             # force-kill the process if necessary.
             KILL_TIMEOUT = 3.0
             timeout = time.time() + KILL_TIMEOUT
+            # poll() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             while self._proc.poll() is None and time.time() < timeout:
                 time.sleep(0.1)
+            # poll() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             if self._proc.poll() is None:
                 _log.warning('stopping %s timed out, killing it' %
                              self._name)
index 29b7ca3..ad557bd 100644 (file)
@@ -258,6 +258,8 @@ class PyWebSocket(http_server.Lighttpd):
         Executive().kill_process(pid)
 
         if self._process:
+            # wait() is not threadsafe and can throw OSError due to:
+            # http://bugs.python.org/issue1731717
             self._process.wait()
             self._process = None