8000 BUG Upgrade Sf 2.5 too many open files running tests · Issue #11566 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

BUG Upgrade Sf 2.5 too many open files running tests #11566

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

Closed
eduardosoliv opened this issue Aug 5, 2014 · 14 comments
Closed

BUG Upgrade Sf 2.5 too many open files running tests #11566

eduardosoliv opened this issue Aug 5, 2014 · 14 comments

Comments

@eduardosoliv
Copy link
Contributor
PHP Warning:  include(/private/var/www/uniplaces/vendor/phpunit/phpunit/src/Framework/TestFailure.php): failed to open stream: Too many open files in /private/var/www/uniplaces/vendor/composer/ClassLoader.php on line 378

A lot of files of test.log appear:

php54   4470 entering   59w   REG    1,2 2305175512  8428713 /private/var/www/uniplaces/app/logs/test.log
php54   4470 entering   60w   REG    1,2 2305175512  8428713 /private/var/www/uniplaces/app/logs/test.log
...

And they grow over and over to > 200

If I downgrade to Sf 2.4 is stable on 2/3 files without any change on the code.

@eduardosoliv eduardosoliv changed the title Upgrade Sf 2.5 too many open files running tests BUG Upgrade Sf 2.5 too many open files running tests Aug 5, 2014
@eduardosoliv
Copy link
Contributor Author

Disable the logging on test with:

# No logging on test environment
monolog:
    handlers:
        main:
            type:   test

Solve it, but some code changed and this ticket should be followed

@romaricdrigon
Copy link
Contributor

I'm having the same issue since I've updated from 2.3.19 to 2.3.20.
I'm investigating, because I guess there must be some configuration trick... I'll keep posting here.

@romaricdrigon
Copy link
Contributor

I've just fixed the bug for me. It's indeed some server configuration. Usually on Unix you have limits on how many files can be opened at the same time.

You can check the limit using ulimit -a, fyi for me on Mac Os X 10.9 it was 256.

You can set it (temporarily) using ulimit -n 1024, for me 1024 was enough. That change will be lost after reboot, if you want to change it permanently I let you search for the appropriate command for your os.

A wild guess, with 2.3.20 (and upper) SF2 must have passed that limit for some classes that are listed (opended by the autoloader?) at the same time.
If some more people have the issue, it may be worth a note in Symfony2 installation documentation, or even "server" requirements.

@eduardosoliv
Copy link
Contributor Author

Disabling logging on tests didn't solved?

You didn't fix the bug you just increase your limit of files, the bug continues there, like I showed before Symfony code keeping opening the file without closing.

For now IMO not having logging on test environment is the best approach.

If this happens in production this is really bad.

@romaricdrigon
Copy link
Contributor

I did not tried, and I'm not sure having no logs in test is something I want. Imo disabling logs is also a workaround...

Ideally, if it's some common issue, we could even add a check to check.php.

@antonioribeiro
Copy link

Yeah, I'm having that too, doing acceptance tests on a Laravel 5 app, which is currently using SF 2.6.

I already raised my box ulimit to 8192 max open files, but it must be something else, because I'm still randomly getting those errors.

poststatuscept fail

@spezifanta
Copy link

I am kinda happy to see that I am not the only one, who gets this error. We are a team of four. 3 Nginx, 1 Apache. 2 of the Nginx get this "Too many open files"-error. Both run Arch Linux, the latest PHP and Symfony 2.6.*.

  • I tried raising ulimit up to 30000.
  • I tried "worker_rlimit_nofile 30000;" in my /etc/nginx/nginx.conf.

The only "workaround" I found so far: restarting php-fpm after the error occurs. This buys me about 2 hours on a normal day.

Havn't tried disabling logging, I'll give that a go. But that should not be the solution.

Edit: ... or sometimes only 10 Minutes. I'm not testing, running in normal development mode.

@kipit
Copy link
Contributor
kipit commented Nov 29, 2014

@spezifanta in your case, it's php that hit the open files limit, so setting things at the webserver level is useless while using php-fpm. Maybe you should try to start php-fpm with a higher open rlimit_files, in an environment which permit it.

@spezifanta
Copy link

We are still having this problem.

@jakzal
Copy link
Contributor
jakzal commented Mar 31, 2015

@spezifanta would you mind to check if the issue persists with xdebug disabled?

@asentner
Copy link

@jakzal I am having the issue only with xdebug remote enabled. Do you know the background behind this? I have not found much online.

@jakzal
Copy link
Contributor
jakzal commented Jun 1, 2015

See http://bugs.xdebug.org/view.php?id=1070. Seems to be related to XDebug+PHPStorm.

@asentner
Copy link
asentner commented Jun 1, 2015

Perfect! Thank you.

@wouterj
Copy link
Member
wouterj commented Jun 18, 2015

So this bug is related to xDebug? In that case, save to close?

@jakzal jakzal closed this as completed Jun 18, 2015
nicolas-grekas added a commit that referenced this issue Jan 6, 2016
…rekas)

This PR was merged into the 2.7 branch.

Discussion
----------

[PhpUnitBridge] Re-enable the garbage collector

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #17268, #11566
| License       | MIT
| Doc PR        | -

The bug is fixed in PHP and disabling the gc causes issues elsewhere.

Commits
-------

478710f [PhpUnitBridge] Re-enable the garbage collector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants
0