WordPress / WordPress/Requests
Failed to open stream: Too many open files in Requests.php
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 3.6k
- Forks
- 500
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 5
Description
While using Requests in a script that shoots out multiple thousands of requests, I get the following error:
PHP Warning: require_once(/.../Requests/Exception.php): failed to open stream: Too many open files in /.../Requests.php on line 136
PHP Fatal error: require_once(): Failed opening required '/.../Requests/Exception.php' (include_path='.:/usr/local/lib/php:/var/www/...') in /.../Requests.php on line 136
I believe this indicates that file handles are not being closed properly.
NOTE: This happens when using the cURL transport only, switching to fsockopen mitigated the issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at Requests.php line 136 and inspect how the cURL transport manages resources across multiple thousands of requests; compare its behavior with the fsockopen transport, which mitigates the issue. Reproduce the failure with repeated cURL requests and verify that the run no longer reaches the "Too many open files" error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100