php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36142 SOAP usage halts session
Submitted: 2006-01-24 13:13 UTC Modified: 2006-01-24 13:26 UTC
From: arekm at pld-linux dot org Assigned:
Status: Closed Package: Session related
PHP Version: 5.1.2 OS: Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: arekm at pld-linux dot org
New email:
PHP Version: OS:

 

 [2006-01-24 13:13 UTC] arekm at pld-linux dot org
Description:
------------
Very long running SOAP query in one tab in web browser halts the same session on the server so nothing can be done in the same app (using the same session) in second tab of the browser.

Reproduce code:
---------------
<?php

session_start();

$cmd = $_GET["cmd"];

if (isset($_SESSION["cnt"]))
        $_SESSION["cnt"]++;
else
        $_SESSION["cnt"] = 0;

switch ($cmd) {
case "soap":
        $client = new SoapClient(NULL, array('location' => "http://www.nask.pl:1000" /* unreachable host */,
                'uri' => "blah",
                'encoding'=>'ISO-8859-2',
                'trace' => true,
                'exceptions' => false));
        $response = $client->__soapCall("blah", array());
        if (is_soap_fault($response))
                echo "SOAP fault<br>";
        break;

case "disp":
        echo "DISPLAY ME " . $_SESSION["cnt"] . "<br>";
        break;
}
?>

<a href="a.php?cmd=soap">soap</a>
<a href="a.php?cmd=disp">disp</a>


Expected result:
----------------
DISPLAY ME X where X increases without waiting for SOAP query to finish.



Actual result:
--------------
Browser waits for server reply and gets it only after soap query finishes.

How to reproduce?
1) open http://somwhere/a.php?cmd=disp in two tabs of the same browser (so php session will be shared)

... where a.php is php script above

2) click disp several times, counter should increase
3) in second tab try click on soap (which will issue soap query to unreachable server/port so it will take long time)
4) back in first tab try to click on disp

now at 4) browser will wait for server to reply until soap query finishes

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-24 13:26 UTC] arekm at pld-linux dot org
Found the solution:
        session_write_close();
        $response = $client->__soapCall("blah", array());
        session_start();
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 11:01:28 2025 UTC