You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I love this library. However it seems to keep files open after a curl request. I cannot seem to find where exactly but it varies between 2-6 files after a request.
I call the embed object from a self written Laravel console command, for a couple of hundred urls to populate a db. This didn’t go well, when I checked the open files, they increase after each call to the object.
Ok, I have narrowed it down to the curl_exec function in CurlDispatcher\exec . It might be a curl specific thing (I don't know the curl object), will look into that. (curl_close does not seem to free the file handlers).
Can not seem to find what curl is doing to keep the file open, given up. As far as I see now it only causes problems in a script which runs the object a lot of times. I expect a web call to close it after every request but I haven't checked.
Hi @dionmes, PR #589 should fix this: there was a curl handle leak on PHP 8. In our test with 40 requests the open descriptors went from 10 to 170, and with the fix they stay at 6.
You can test it with composer require embed/embed:dev-fix/4.5.5. We will leave the PR open for a few days before releasing 4.5.5, so any feedback is very welcome!
Activity
oscarotero commentedon Jul 17, 2018
I cannot detect this. All curl request should be closed, as you can see here: https://github.com/oscarotero/Embed/blob/master/src/Http/CurlDispatcher.php#L157
and here: https://github.com/oscarotero/Embed/blob/master/src/Http/CurlDispatcher.php#L253
Can you provide more information?
Thanks.
dionmes commentedon Jul 17, 2018
I call the embed object from a self written Laravel console command, for a couple of hundred urls to populate a db. This didn’t go well, when I checked the open files, they increase after each call to the object.
dionmes commentedon Jul 17, 2018
Ok, I have narrowed it down to the curl_exec function in CurlDispatcher\exec . It might be a curl specific thing (I don't know the curl object), will look into that. (curl_close does not seem to free the file handlers).
dionmes commentedon Jul 18, 2018
Can not seem to find what curl is doing to keep the file open, given up. As far as I see now it only causes problems in a script which runs the object a lot of times. I expect a web call to close it after every request but I haven't checked.
geoffoliver commentedon Jan 1, 2020
FWIW, setting these options to
truein the CurlDispatcher config seems to solve the problem...CURLOPT_FORBID_REUSECURLOPT_FRESH_CONNECTVitorinox commentedon Oct 31, 2026
Hi @dionmes, PR #589 should fix this: there was a curl handle leak on PHP 8. In our test with 40 requests the open descriptors went from 10 to 170, and with the fix they stay at 6.
You can test it with
composer require embed/embed:dev-fix/4.5.5. We will leave the PR open for a few days before releasing 4.5.5, so any feedback is very welcome!dionmes commentedon Nov 1, 2026
@Vitorinox thank you. Project is currently deprecated.