diff options
author | Jürg Billeter <j@bitron.ch> | 2018-02-06 10:50:04 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-02-06 10:53:54 +0100 |
commit | 0e0990c5557f3b454f54f412d3c28c4bd4b4aaf7 (patch) | |
tree | 36ab1fbb207020dbe73d9fb9ab13c8731ba44413 /buildstream/_frontend/main.py | |
parent | 945054df3821b7b53183983625f87c2e46fb6dd3 (diff) | |
download | buildstream-0e0990c5557f3b454f54f412d3c28c4bd4b4aaf7.tar.gz |
Increase the soft limit for open file descriptorsjuerg/fuse-rlimit
SafeHardlinks FUSE needs to hold file descriptors for all processes in
the sandbox. Avoid hitting the limit too quickly by increasing the soft
limit to the maximum.
Fixes #232
Diffstat (limited to 'buildstream/_frontend/main.py')
-rw-r--r-- | buildstream/_frontend/main.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/buildstream/_frontend/main.py b/buildstream/_frontend/main.py index fc5372048..1abbd3592 100644 --- a/buildstream/_frontend/main.py +++ b/buildstream/_frontend/main.py @@ -20,6 +20,7 @@ import os import sys import click +import resource from contextlib import contextmanager from blessings import Terminal from click import UsageError @@ -778,6 +779,14 @@ class App(): else: self.colors = False + # Increase the soft limit for open file descriptors to the maximum. + # SafeHardlinks FUSE needs to hold file descriptors for all processes in the sandbox. + # Avoid hitting the limit too quickly. + limits = resource.getrlimit(resource.RLIMIT_NOFILE) + if limits[0] != limits[1]: + # Set soft limit to hard limit + resource.setrlimit(resource.RLIMIT_NOFILE, (limits[1], limits[1])) + # # Initialize the main pipeline # |