amccarth created this revision.
amccarth added a reviewer: tfiala.
amccarth added a subscriber: lldb-commits.

Python uses stdio from the C runtime for file descriptors and pipes.  On 
Windows, by default, the CRT has a limit of 512 open file descriptors.  
https://msdn.microsoft.com/en-us/library/6e3b887c.aspx

The parent dotest process ends up with several FDs for each process running a 
test in parallel.  At about 37-38 logical cores we started hitting this limit 
regularly.

This patch works around the problem by capping the threads to 32 on Windows.

http://reviews.llvm.org/D13555

Files:
  test/dosep.py

Index: test/dosep.py
===================================================================
--- test/dosep.py
+++ test/dosep.py
@@ -1350,6 +1350,11 @@
                 runner_strategies_by_name.keys()))
     test_runner_func = runner_strategies_by_name[test_runner_name]
 
+    # On Windows, Python uses CRT with a low limit on the number of open files.
+    # Capping the number of threads avoids "OSError: too many open files."
+    if os.name == 'nt' and num_threads > 32:
+        num_threads = 32
+
     summary_results = walk_and_invoke(
         test_directory, test_subdir, dotest_argv,
         num_threads, test_runner_func)


Index: test/dosep.py
===================================================================
--- test/dosep.py
+++ test/dosep.py
@@ -1350,6 +1350,11 @@
                 runner_strategies_by_name.keys()))
     test_runner_func = runner_strategies_by_name[test_runner_name]
 
+    # On Windows, Python uses CRT with a low limit on the number of open files.
+    # Capping the number of threads avoids "OSError: too many open files."
+    if os.name == 'nt' and num_threads > 32:
+        num_threads = 32
+
     summary_results = walk_and_invoke(
         test_directory, test_subdir, dotest_argv,
         num_threads, test_runner_func)
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to