[Lldb-commits] [PATCH] D13555: Cap test threads on Windows to avoid open file limit

Adrian McCarthy via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 8 07:51:29 PDT 2015


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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13555.36855.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20151008/02ede838/attachment.bin>


More information about the lldb-commits mailing list