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

Add emerge options to require free space/inodes in tmpdir #1353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 23, 2024

  1. Add emerge options to require free space/inodes in tmpdir

    This adds
      --jobs-tmpdir-require-free-gb=GB
      --jobs-tmpdir-require-free-kilo-inodes=INODES
    as emerge emerge options.
    
    When those are used with --jobs, makes portage/emerge check that
    PORTAGE_TMPDIR has sufficient free resources before a new job is
    started.
    
    Thanks goes out to Zac Medico, as this was inspired by
    gentoo#1351, with the following
    differences:
    
    - options are absolute values, not relatives ones
    - defaults for both options are specified
    - option values are scaled, using a decaying function, considering
      the number or running jobs
    - emit a warning once a threshold is reached
    
    Note that the scaling of the resource constraints can not be perfect
    in the presence of concurrently running emerge jobs and without
    _can_add_job() being provided with the number of jobs that are
    potentially added. It is always possible that a emerge job has not yet
    used much of the filesystem when we check the remaining filesystem
    resources, and later on uses much more than the scaling function
    accounted for it.
    
    Ultimately, there is a tradeoff between portage limiting parallelism
    needlessly (but still being able to emerge all packages) and portage
    failing due to missing resources in PORTAGE_TMPDIR. The chosen
    defaults are rather large and most packages use much less
    filesystem resources then the scaling function accounts for
    them. Therefore, the implemented approach idea is to lean towards
    favoring functionality over parallelism.
    
    Bugs: https://bugs.gentoo.org/934382
    Signed-off-by: Florian Schmaus <[email protected]>
    Flowdalic committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    0c56537 View commit details
    Browse the repository at this point in the history