Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Too many open files" when running with remote execution #1842

Open
abderrahim opened this issue May 13, 2023 · 2 comments
Open

"Too many open files" when running with remote execution #1842

abderrahim opened this issue May 13, 2023 · 2 comments
Labels
bug Something isn't working remote execution Related to remote execution

Comments

@abderrahim
Copy link
Contributor

When building with remote execution, I get the following error. I don't know if it's consistent, but retrying once gives the same error.

[16:35:19][00:11:56][e8a2758a][   build:bootstrap/build/gcc-stage1.bst] BUG     Build

    An unhandled exception occured:
    
    Traceback (most recent call last):
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_scheduler/jobs/job.py", line 438, in child_action
        result = self.child_process()  # pylint: disable=assignment-from-no-return
                 ^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_scheduler/jobs/elementjob.py", line 91, in child_process
        return self._action_cb(self._element)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_scheduler/queues/buildqueue.py", line 55, in _assemble_element
        element._assemble()
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/element.py", line 1689, in _assemble
        collect = self.assemble(sandbox)  # pylint: disable=assignment-from-no-return
                  ^^^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/buildelement.py", line 315, in assemble
        with sandbox.batch(root_read_only=True, label="Running commands"):
      File "/usr/lib/python3.11/contextlib.py", line 144, in __exit__
        next(self.gen)
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/sandbox/sandbox.py", line 265, in batch
        batch.execute()
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/sandbox/_sandboxreapi.py", line 234, in execute
        self.sandbox._run_with_flags(
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/sandbox/sandbox.py", line 374, in _run_with_flags
        return self._run(command, flags=flags, cwd=cwd, env=env)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/sandbox/_sandboxreapi.py", line 101, in _run
        action_result = self._execute_action(action, flags)  # pylint: disable=assignment-from-no-return
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/sandbox/_sandboxremote.py", line 221, in _execute_action
        cascache.pull_tree(casremote, tree_digest)
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_cas/cascache.py", line 278, in pull_tree
        digest = self._fetch_tree(remote, digest)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_cas/cascache.py", line 644, in _fetch_tree
        dirdigests = self.add_objects(buffers=dirbuffers)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_cas/cascache.py", line 370, in add_objects
        tmp = stack.enter_context(self._temporary_object())
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/contextlib.py", line 505, in enter_context
        result = _enter(cm)
                 ^^^^^^^^^^
      File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
        return next(self.gen)
               ^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/_cas/cascache.py", line 595, in _temporary_object
        with utils._tempnamedfile(dir=self.tmpdir) as f:
      File "/usr/lib/python3.11/contextlib.py", line 137, in __enter__
        return next(self.gen)
               ^^^^^^^^^^^^^^
      File "/home/abderrahimkitouni/.local/pipx/venvs/buildstream/lib/python3.11/site-packages/buildstream/utils.py", line 1268, in _tempnamedfile
        with _signals.terminator(close_tempfile), tempfile.NamedTemporaryFile(
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/tempfile.py", line 702, in NamedTemporaryFile
        file = _io.open(dir, mode, buffering=buffering,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/tempfile.py", line 699, in opener
        fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/tempfile.py", line 395, in _mkstemp_inner
        fd = _os.open(file, flags, 0o600)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    OSError: [Errno 24] Too many open files: '/home/abderrahimkitouni/.cache/buildstream/tmp/tmpr9a6fdwb'
@abderrahim abderrahim added bug Something isn't working remote execution Related to remote execution labels May 13, 2023
@nanonyme
Copy link
Contributor

nanonyme commented Nov 5, 2023

@abderrahim did you ever figure out what this was about? Is there some fd leak?

@abderrahim
Copy link
Contributor Author

Nope, I just increased the limit with ulimit and got my build going.

abderrahim added a commit that referenced this issue Oct 11, 2024
This gives us an output that is easier to manipulate given we're using
buildbox-casd, and allows to avoid a whole class of bugs such as #1842
and #1961

The old code for handling the output as a Tree is kept for now as the
remote execution spec recommends using it as a fallback
abderrahim added a commit that referenced this issue Oct 11, 2024
This gives us an output that is easier to manipulate given we're using
buildbox-casd, and allows to avoid a whole class of bugs such as #1842
and #1961

The old code for handling the output as a Tree is kept for now as the
remote execution spec recommends using it as a fallback
abderrahim added a commit that referenced this issue Oct 14, 2024
This gives us an output that is easier to manipulate given we're using
buildbox-casd, and allows to avoid a whole class of bugs such as #1842
and #1961

The old code for handling the output as a Tree is kept for now as the
remote execution spec recommends using it as a fallback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working remote execution Related to remote execution
Projects
None yet
Development

No branches or pull requests

2 participants