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

batch tmutil call args to prevent argument list too long errors #1873

Merged
merged 1 commit into from
Sep 20, 2024

Conversation

zackattack01
Copy link
Contributor

We're seeing 18k errors logged in the last two days for fork/exec /usr/bin/tmutil: argument list too long - I am unable to reproduce this error on my machine but some brief research indicates that this is determined by the ARG_MAX set per machine.

We generate the filepaths for exclusion based on the output of filepath.Glob on our predefined patterns. This can also vary slightly per machine (mostly by the count of debug logs at the time this runs). To keep this simple I've approximated two equal (ish) batches of patterns, moved the exclusion logic into a helper, and run it twice. This should cut the args per call roughly in half and reduce the likelihood of hitting this error

Copy link
Contributor

@RebeccaMahany RebeccaMahany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find!!

@RebeccaMahany RebeccaMahany added the bug-fixes Bug Fixes label Sep 20, 2024
Copy link
Contributor

@James-Pickett James-Pickett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@zackattack01 zackattack01 added this pull request to the merge queue Sep 20, 2024
Merged via the queue into main with commit fb6d91a Sep 20, 2024
30 checks passed
@zackattack01 zackattack01 deleted the zack/batch_tmutil_call branch September 20, 2024 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-fixes Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants