Re: Apache::SizeLimit ( mp1 and mp2 )-> I think there is a logical error in the code ...

[prev] [thread] [next] [Date index for 2005/05/24]

From: Torsten Foertsch
Subject: Re: Apache::SizeLimit ( mp1 and mp2 )-> I think there is a logical error in the code ...
Date: 09:19 on 24 May 2005
--nextPart10645399.PsDYNSxXKG
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Tuesday 24 May 2005 09:39, Andreas.Nolte@xxxxxxxxxxx.xx wrote:
> I claim, the "main process " detection does never work and does not make
> sense. Why? Not even when the apache is started on boot through init, the
> PPID will be 1, but some shell / rc pid. =C2=A0You can only find the PPID=
 in the
> PID file that apache writes. But still: this should never be the case -
> right ?=20

Normally Apache forks on startup to get rid of its parent. So the init-proc=
ess=20
(1) inherits the orphan. Then Apache spawns its workers that are direct=20
children of the master Apache. Hence the test is in principle right.

r2@opi:~> ps -lC httpd
=46 S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
5 S     0  7155     1  0  76   0 -  2756 -      ?        00:00:00 httpd
5 S    30  7158  7155  0  80   0 -  2774 322495 ?        00:00:00 httpd
5 S    30  7159  7155  0  80   0 -  2774 semtim ?        00:00:00 httpd

PID 7155 is the main apache. It's PPID is 1.

But there is a problem with Perls getppid() implementation. Modern Perls is=
sue=20
the syscall only once and cache the result. Maybe you somehow hit that.=20
Normally the cache is invalidated when Perl forks, but Apache does its own=
=20
fork. Thus maybe the cache remains.

I'd try to replace getppid with syscall( &SYS_getppid ) and see if it chang=
es=20
anything.

Torsten

--nextPart10645399.PsDYNSxXKG
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBCkvGcwicyCTir8T4RAktPAJ9ejijSW7t3fDyDGFRdJxVklOzr6wCfQ85b
hHZqRRFVoqWPSyLDnmlmMfU=
=UNRn
-----END PGP SIGNATURE-----

--nextPart10645399.PsDYNSxXKG--

Re: Apache::SizeLimit ( mp1 and mp2 )-> I think there is a logical error in the code ...
Torsten Foertsch 09:19 on 24 May 2005

Generated at 15:53 on 25 May 2005 by mariachi v0.52