|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-05-11 11:27 UTC] cmb@php.net
[2021-05-17 14:43 UTC] nikic@php.net
[2022-12-08 06:00 UTC] kimia dot salamsao9881 at gmail dot com
[2022-12-15 11:06 UTC] johnsonsellen at gmail dot com
[2022-12-21 08:54 UTC] jbriss at ebridge dot sk
[2022-12-21 11:45 UTC] schamberumarcelo at gmail dot com
[2023-01-14 14:00 UTC] insidestrongs at gmail dot com
[2023-02-09 16:08 UTC] meghaagarwalbaniya at gmail dot com
[2023-04-01 01:35 UTC] ammarloner at gmail dot com
[2023-04-05 07:21 UTC] mikejohnarzona at gmail dot com
[2023-05-16 16:52 UTC] venile2040 at dekaps dot com
[2023-05-21 12:14 UTC] johnsonsellen at gmail dot com
[2023-07-22 14:50 UTC] forseobirdawade at gmail dot com
[2023-08-10 15:37 UTC] andrewsauder at gmail dot com
[2023-10-31 18:44 UTC] owork138 at gmail dot com
[2023-10-31 18:47 UTC] owork138 at gmail dot com
[2023-12-16 04:37 UTC] emmaturner at gmail dot com
[2023-12-16 04:39 UTC] sincerelyjulie0 at gmail dot com
[2023-12-16 04:49 UTC] emmaturner at gmail dot com
[2025-07-02 16:49 UTC] nielsdos@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nielsdos
[2025-07-02 16:49 UTC] nielsdos@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 13:00:01 2025 UTC |
Description: ------------ If a SoapClient object is constructed without specifying the 'keep_alive' option to false, the socket never appears to be closed if it falls out of scope The provided script should be able to reproduce this, you can check the open sockets by running the script like: "php /path/to/script.php &" and using the resulting PID on "lsof -a -p {pid}" You should slowly see a list of TCP connections slowly build up over time similar to this: php 4396 vagrant 3u IPv4 53416 0t0 TCP homestead:57814->ec2-52-7-155-169.compute-1.amazonaws.com:https (ESTABLISHED) php 4396 vagrant 4u IPv4 53447 0t0 TCP homestead:57816->ec2-52-7-155-169.compute-1.amazonaws.com:https (ESTABLISHED) php 4396 vagrant 5u IPv4 54451 0t0 TCP homestead:57818->ec2-52-7-155-169.compute-1.amazonaws.com:https (ESTABLISHED) If instead you were to add ['keep_alive' => false] as the options parameter on the SoapClient you'll see that the TCP connections don't appear to build up. While I do understand the purpose of Keep Alive to keep a single connection open, I would assume this is still a bug as the SoapClient has gone out of scope and new SoapClient objects don't appear to reuse the existing connection and simply ignore it creating a new one. Test script: --------------- <?php function call(int $number) { $client = new SoapClient('https://www.dataaccess.com/webservicesserver/NumberConversion.wso?WSDL'); $response = $client->NumberToWords(['ubiNum' => $number]); return $response->NumberToWordsResult; } $numbers = array_fill(0, 10000, 1); foreach ($numbers as $number) { call($number); } Expected result: ---------------- The socket to be closed when the SoapClient object falls out of scope or destructs Actual result: -------------- The socket stays open and contributes to the open file limit / file descriptor limit