This is an archive of the discontinued LLVM Phabricator instance.

Cap test threads on Windows to avoid open file limit
ClosedPublic

Authored by amccarth on Oct 8 2015, 7:51 AM.

Details

Summary

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.

Diff Detail

Repository
rL LLVM

Event Timeline

amccarth updated this revision to Diff 36855.Oct 8 2015, 7:51 AM
amccarth retitled this revision from to Cap test threads on Windows to avoid open file limit.
amccarth updated this object.
amccarth added a reviewer: tfiala.
amccarth added a subscriber: lldb-commits.

Hold off. I just got a failure even at only 32 subprocesses.

amccarth updated this revision to Diff 36993.Oct 9 2015, 2:28 PM

Using the multiprocessing-pool mode seems more reliable than capping num_threads. I'm doing it only when the number of threads is high because of the loss of Ctrl+C support.

tfiala edited edge metadata.Oct 10 2015, 9:06 PM

LGTM, Adrian!

tfiala accepted this revision.Oct 10 2015, 9:06 PM
tfiala edited edge metadata.
This revision is now accepted and ready to land.Oct 10 2015, 9:06 PM
This revision was automatically updated to reflect the committed changes.