|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20004 ignore_user_abort() and connection_aborted()
Submitted: 2002-10-21 03:53 UTC Modified: 2002-11-10 18:23 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: buvry at enseeiht dot fr Assigned:
Status: No Feedback Package: PHP options/info functions
PHP Version: 4.2.3 OS: Solaris 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: buvry at enseeiht dot fr
New email:
PHP Version: OS:


 [2002-10-21 03:53 UTC] buvry at enseeiht dot fr
 I use Apache 1.3.26 and postgresql 7.2.2

I wished to test ignore_user_abort() and connection_aborted(). I can not use correctly
this 2 fonctions. The result is always the same.

The application is the famous example of the bank accounts and the money transfers. I consider a table named "DEAL" where each transaction is saved. Each tuple has an id 
number as key.

My script php follows this steps :

        Compute the key -> v
        BEGIN WORK
        UPDATE the first bank account with v (credit)
        UPDATE the second bank account with v+1 (debit)

While the sleep, the client uses the STOP button on his browser and stops the connection.

For these tests, I follow two steps :

1/ the client execute the first request but stops the connection
while the sleep instruction.
2/ with pgaccess, I read the content of DEAL after a while


Compute the key -> v
UPDATE the first bank account with v as key (credit)
sleep(300)                            ------> INTERRUPT !!!!
UPDATE the second bank account with v+1 as key (debit)

Result : after a while (timeout ?), the request is
executed. Therefore the script is executed totally.
Otherwise, this timeout is also a problem because if
the client make again his request, it fails beacause
the found key is the same as the previous and one update
fails (but this problem comes from the first problem) !


The same by removing BEGIN and COMMIT.

The result is the same, even if the "timeout" is more

TEST 3 and 4

The tests 3 and 4 reproduce the test 1 and 2 by using

The results are absolutely the same !

TEST 5 and 6

The tests 5 and 6 reproduce the test 1 and 2 by using ROLLBACK
if ( connection_aborted() ) { ROLLBACK WORK; exit } is added
after the sleep.

The results are absolutely the same again ! It seem 
connection_aborted does not return correct result.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-21 03:56 UTC]
Please try using this CVS snapshot:
For Windows:
 [2002-11-10 18:23 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 22 19:01:29 2024 UTC