You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/12/11 07:40:26 UTC

DO NOT REPLY [Bug 46379] New: unexpected termination

https://issues.apache.org/bugzilla/show_bug.cgi?id=46379

           Summary: unexpected termination
           Product: Apache httpd-2
           Version: 2.2.10
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: Event MPM
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: ncross42@cyworld.com


Description:
This bug is a apache-thread related php excution bug.

This bug is repeatable and clear.

1. System setting.
 a. apache-2.2.10 : mpm=worker and using shared modules.
-=-=-= httpd.conf =-=-=-
for simple test, values are low.
<IfModule worker.c>
StartServers        1
MinSpareThreads     2
MaxSpareThreads     4
ThreadsPerChild     2   # <- this is important.
MaxRequestsPerChild 5   # <- this is important.
</IfModule>

 b. PHP-5.2.8 : using apxs2 and enable-maintainer-zts for threadsafe
(no external cache like APC or XCache)


Reproduce code:
-=-= code of 1.php =-=-
<?php
 echo '1<br>';

 echo date("H:i:s").'<br>';
sleep(10);
 echo date("H:i:s").'<br>';
?>

-=-= code of 2.php =-=-
<?php
 echo '2<br>';

 echo date("H:i:s").'<br>';
 echo date("H:i:s").'<br>';
?>

Expected result:
<bug scenario>

 (a) browse 1.php and 2.php <concurrently ONCE>. result are not problem.
-=-= result page of 1.php =-=-
1
11:04:29
11:04:39
-=-= result page of 2.php =-=-
2
11:04:30
11:04:30

 (b) I expected ...
  - browse 1.php and 2.php
  - refresh 2.php over 10 times very fast within 10 sec. (yes, using F5)
  - I expected below normal resuluts.
-=-= result page of 1.php =-=-
1
11:12:47
11:12:57
-=-= result page of 2.php =-=-
2
11:12:57
11:12:57


Actual result:
-=-= result page of 1.php =-=-
1
11:49:00
11:49:02
-=-= result page of 2.php =-=-
2
11:49:02
11:49:02
<ANALYSIS>

 (a) initial apache process is here
Shell> ps ax | grep httpd
 5697 ?        Ss     0:00 /skcomms/apache/bin/httpd -k restart
 5964 ?        Sl     0:00 /skcomms/apache/bin/httpd -k restart
  - becuase below apache setting
<IfModule worker.c>
StartServers        1
MinSpareThreads     2
ThreadsPerChild     2
...
</IfModule>

 (b) suppose
  - in (a) action, two connection is established with process 5964
  - in (b) action, new 1.php is sleeping in 5964 and 2.php is excuted in other
new process because below reason.
<IfModule worker.c>
...
ThreadsPerChild     2
MaxRequestsPerChild 5
</IfModule>

 (c) expected in 1.php excution time (within 10 sec)
 5697 ?        Ss     0:00 /skcomms/apache/bin/httpd -k restart
 5964 ?        Sl     0:00 /skcomms/apache/bin/httpd -k restart (1.php is
sleeping here)
 597x ?        Sl     0:00 /skcomms/apache/bin/httpd -k restart (2.php is
browsed here)

 (d) but actually 5964 is terminated early in 2 seconds.
 5697 ?        Ss     0:00 /skcomms/apache/bin/httpd -k restart
 5991 ?        Sl     0:00 /skcomms/apache/bin/httpd -k restart


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 46379] unexpected termination

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=46379


Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|NEW                         |RESOLVED
          Component|Event MPM                   |worker
         Resolution|                            |INVALID




--- Comment #1 from Eric Covener <co...@gmail.com>  2008-12-11 00:14:20 PST ---
The php manual has comments saying sleep() wakes up when you receive any signal
(like the traditional C library call documents, man 3 sleep)

Termination due to MaxRequestsPerchild is implemented via a signal. 


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org