2010-04-27 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Apr 2010 17:50:03 +0000 (17:50 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Apr 2010 17:50:03 +0000 (17:50 +0000)
commitae7ffaa9d68fb09cdf23b97b5a8be68762704883
tree144bc830049d9c3204a06b90f4a973e3b5c6d416
parent47a0d68094442352917ed22e7f5615f64e301f90
2010-04-27  Eric Seidel  <eric@webkit.org>

        Reviewed by Adam Barth.

        [chromium] new-run-webkit-tests hangs on Chromium Bots (OS X and Linux)
        https://bugs.webkit.org/show_bug.cgi?id=37987

        After further research, I believe the hang is caused by:
        http://bugs.python.org/issue2320
        Basically Popen() is not reentrant.
        The workaround is to pass close_fds=True to Popen() on Mac/Linux.

        I fixed our main Popen wrapper "Executive.run_command" to use close_fds=True
        when appropriate.

        I audited all places we call Popen() and either moved them to run_command
        or left a FIXME that they are not thread safe.  A few places I added the
        close_fds workaround there and left an explanitory note.

        * Scripts/webkitpy/common/checkout/scm_unittest.py:
         - Added note that this Popen use is not threadsafe.
        * Scripts/webkitpy/common/system/executive.py:
         - Fixed our Executive.run_* to workaround python bug 2320.
        * Scripts/webkitpy/common/system/user.py:
         _ Added note that this Popen use is not threadsafe.
        * Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py: ditto.
        * Scripts/webkitpy/layout_tests/port/apache_http_server.py: ditto.
        * Scripts/webkitpy/layout_tests/port/base.py:
         - Change wdiff back to using run_command now that we believe it
           to be threadsafe.
        * Scripts/webkitpy/layout_tests/port/chromium.py:
         - Fix to use Executive in places.
         - Pass self._executive down to the Driver for easier unit testing.
        * Scripts/webkitpy/layout_tests/port/chromium_win.py:
         - Re-factor to use a _kill_all method.
         - Made the _kill_all method use run_command to be threadsafe.
        * Scripts/webkitpy/layout_tests/port/http_server.py:
         - Add FIXME about using Executive.
        * Scripts/webkitpy/layout_tests/port/server_process.py:
         - Use Executive to be threadsafe.
        * Scripts/webkitpy/layout_tests/port/webkit.py:
         - Pass self._executive down to the Driver.
        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
         - Add note about Popen not being threadsafe.
        * Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py:
         - Move one caller to run_command add notes about moving others.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58314 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/common/checkout/scm_unittest.py
WebKitTools/Scripts/webkitpy/common/system/executive.py
WebKitTools/Scripts/webkitpy/common/system/user.py
WebKitTools/Scripts/webkitpy/layout_tests/layout_package/json_results_generator.py
WebKitTools/Scripts/webkitpy/layout_tests/port/apache_http_server.py
WebKitTools/Scripts/webkitpy/layout_tests/port/base.py
WebKitTools/Scripts/webkitpy/layout_tests/port/chromium.py
WebKitTools/Scripts/webkitpy/layout_tests/port/chromium_win.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/webkit.py
WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py
WebKitTools/Scripts/webkitpy/layout_tests/rebaseline_chromium_webkit_tests.py