#36142 [Opn->Csd]: SOAP usage halts session

From: Date: Tue, 24 Jan 2006 12:26:33 +0000
Subject: #36142 [Opn->Csd]: SOAP usage halts session
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92414@lists.php.net to get a copy of this message
 ID:               36142
 User updated by:  arekm at pld-linux dot org
 Reported By:      arekm at pld-linux dot org
-Status:           Open
+Status:           Closed
 Bug Type:         Session related
 Operating System: Linux
 PHP Version:      5.1.2
 New Comment:

Found the solution:
        session_write_close();
        $response = $client->__soapCall("blah", array());
        session_start();


Previous Comments:
------------------------------------------------------------------------

[2006-01-24 13:13:36] 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


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=36142&edit=1


Thread (2 messages)

« previous php.bugs (#92414) next »