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

lock_file: better message if too many open files #14879

Merged
merged 1 commit into from Mar 7, 2023

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Mar 4, 2023

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

I ran into the same issue reported in #11530 (somehow my ulimit -n was only 256), but I found the error message a bit confusing, and it took me a while to find the recommendation to adjust ulimit -n. I've added a rescue Errno::EMFILE around the offending call in lock_file.rb and added an onoe message that recommends using ulimit -n to increase the maximum number of open files.

$ brew upgrade osrf/simulation/gz-sim7 --debug
...
==> Upgrading osrf/simulation/gz-sim7
  7.3.0 -> 7.4.0 

Error: Consider using `ulimit -n` to increase the maximum number of open files allowed on this system.
Error: Too many open files @ rb_sysopen - /usr/local/var/homebrew/locks/gz-physics6.formula.lock
/usr/local/Homebrew/Library/Homebrew/lock_file.rb:46:in `initialize'
/usr/local/Homebrew/Library/Homebrew/lock_file.rb:46:in `open'
/usr/local/Homebrew/Library/Homebrew/lock_file.rb:46:in `open'
/usr/local/Homebrew/Library/Homebrew/lock_file.rb:46:in `create_lockfile'
/usr/local/Homebrew/Library/Homebrew/lock_file.rb:20:in `lock'
/usr/local/Homebrew/Library/Homebrew/formula.rb:1352:in `lock'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:1293:in `each'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:1293:in `lock'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:376:in `install'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:203:in `install_formula'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:176:in `upgrade_formula'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:86:in `block in upgrade_formulae'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:85:in `each'
/usr/local/Homebrew/Library/Homebrew/upgrade.rb:85:in `upgrade_formulae'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:194:in `upgrade_outdated_formulae'
/usr/local/Homebrew/Library/Homebrew/cmd/upgrade.rb:116:in `upgrade'
/usr/local/Homebrew/Library/Homebrew/brew.rb:93:in `<main>'

@BrewTestBot
Copy link
Member

Review period will end on 2023-03-07 at 00:00:00 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 4, 2023
Copy link
Contributor

@apainintheneck apainintheneck left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

@MikeMcQuaid MikeMcQuaid added the critical Critical change which should be shipped as soon as possible. label Mar 6, 2023
@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 6, 2023
@BrewTestBot
Copy link
Member

BrewTestBot commented Mar 6, 2023

Review period ended.

Recommend using `ulimit -n` to increase maximum
number of open files.
@MikeMcQuaid MikeMcQuaid merged commit 0209ba1 into Homebrew:master Mar 7, 2023
@MikeMcQuaid
Copy link
Member

Thanks again @scpeters!

@scpeters scpeters deleted the max_open_files_message branch March 7, 2023 22:30
@github-actions github-actions bot added the outdated PR was locked due to age label Apr 7, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
critical Critical change which should be shipped as soon as possible. outdated PR was locked due to age
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants