APR does not understand this error code
APR does not understand this error code
am 10.05.2011 21:15:29 von Thomas den Braber
Hi,
I am still having these errors for my modperl installation on windows.
I use the lates Modperl 2.05 and hava tested with Perl 5.10.1 and 5.12
(activestate) but both give the same results.
Also tested on Windows 2003 and 2008 server.
The full error is: Apache2 IO flush: (620018) APR does not understand this
error code at -e line 0
This error happens if the loading of a web page is aborted while not all
data is send to the client.
After this the current child process restarts.
In http://www.gossamer-threads.com/lists/modperl/dev/102357 it
looks like it is solved.
Does this path not work ?
Can anyone help me with this ?
--
Thomas den Braber
RE: APR does not understand this error code
am 10.05.2011 22:39:24 von John Deighan
We were getting this behavior in our web application. It appears that we've=
fixed it (we're still testing it) by checking the return value from each p=
rint statement (usually we call the Apache request object's print method) a=
nd aborting (by calling die() in our application - we have an all-encompasi=
ng try block) if print returns a false value. I would give that a try.=0A=
________________________________________=0A=
From: Thomas den Braber [thomas@delos.nl]=0A=
Sent: Tuesday, May 10, 2011 3:15 PM=0A=
To: modperl List=0A=
Subject: APR does not understand this error code=0A=
=0A=
Hi,=0A=
=0A=
I am still having these errors for my modperl installation on windows.=0A=
=0A=
I use the lates Modperl 2.05 and hava tested with Perl 5.10.1 and 5.12=0A=
(activestate) but both give the same results.=0A=
=0A=
Also tested on Windows 2003 and 2008 server.=0A=
=0A=
The full error is: Apache2 IO flush: (620018) APR does not understand this=
=0A=
error code at -e line 0=0A=
=0A=
This error happens if the loading of a web page is aborted while not all=0A=
data is send to the client.=0A=
=0A=
After this the current child process restarts.=0A=
=0A=
In http://www.gossamer-threads.com/lists/modperl/dev/102357 it=0A=
looks like it is solved.=0A=
=0A=
Does this path not work ?=0A=
Can anyone help me with this ?=0A=
=0A=
--=0A=
Thomas den Braber=0A=
=0A=
=0A=
RE: APR does not understand this error code
am 11.05.2011 17:15:19 von Thomas den Braber
> We were getting this behavior in our web application. It appears that
> we've fixed it (we're still testing it) by checking the return value
> from each print statement (usually we call the Apache request object's
> print method) and aborting (by calling die() in our application - we
> have an all-encompasing try block) if print returns a false value. I
> would give that a try.
> ________________________________________
I was thinking about that solution to, but that makes the code less clean,
all the if statements makes it harder to read.
I think it is better to fix this in Mod Perl than making workaround.
Especially for newbies or CGI migrate project that have lots of existing code.
Re: APR does not understand this error code
am 11.05.2011 18:23:50 von torsten.foertsch
On Wednesday, May 11, 2011 17:15:19 Thomas den Braber wrote:
> I think it is better to fix this in Mod Perl than making workaround.
Patches are welcome, really. Currently, we are quite short of Windows=20
programmers.
Torsten Förtsch
=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)
Like fantasy? http://kabatinte.net
Re: APR does not understand this error code
am 17.05.2011 21:08:59 von torsten.foertsch
On Tuesday, May 10, 2011 21:15:29 Thomas den Braber wrote:
> In http://www.gossamer-threads.com/lists/modperl/dev/102357 it
> looks like it is solved.
Thomas, could you please check if the patch at
http://www.gossamer-threads.com/lists/modperl/dev/102983#102 983
fixes your problem? It sounds quite similar. BTW, I have tried to=20
reproduce the problem on Linux without success.
On Tuesday, May 17, 2011 17:27:29 Steve Hay wrote:
> Any thoughts on whether this change is good to commit?
Steve, I have tried your patch on my linux box. It passes all tests=20
successfully. So, I think go ahead and commit it.
One thing I don't catch, can this thing happen only in=20
mpxs_Apache2__RequestRec_rflush()? I believe it can also happen in all=20
the other write operations. If the process crashes on this error I think=20
they should also be fixed. Though, without a proper test case it's like=20
fishing in murky waters.
Torsten Förtsch
=2D-=20
Need professional modperl support? Hire me! (http://foertsch.name)
Like fantasy? http://kabatinte.net
RE: APR does not understand this error code
am 18.05.2011 11:08:03 von Steve Hay
Torsten Förtsch wrote on 2011-05-17:
> On Tuesday, May 10, 2011 21:15:29 Thomas den Braber wrote:
>> In http://www.gossamer-threads.com/lists/modperl/dev/102357 it
>> looks like it is solved.
>=20
> Thomas, could you please check if the patch at
>=20
> http://www.gossamer-threads.com/lists/modperl/dev/102983#102 983
>=20
> fixes your problem? It sounds quite similar. BTW, I have tried to
> reproduce the problem on Linux without success.
>=20
> On Tuesday, May 17, 2011 17:27:29 Steve Hay wrote:
>> Any thoughts on whether this change is good to commit?
>=20
> Steve, I have tried your patch on my linux box. It passes all tests
> successfully. So, I think go ahead and commit it.
>=20
> One thing I don't catch, can this thing happen only in
> mpxs_Apache2__RequestRec_rflush()? I believe it can also happen in all
> the other write operations. If the process crashes on this error I =
think
> they should also be fixed. Though, without a proper test case it's =
like
> fishing in murky waters.
>=20
Ok, I'll commit that fix shortly.
There are indeed other print / write functions with the same =
MP_RUN_CROAK check in them which will throw an exception if an error =
(e.g. an aborted connection) occurs, but the solution there is to eval { =
} every print() call in your code (tedious if you print() HTML out line =
by line, but fine if you build up the page in memory and only output =
with a single print() call) and/or have an all-encompassing eval round =
the whole program.
I find it's always a good idea to wrap the whole program in an eval { } =
to catch any problem that might occur, but as long as you have an eval { =
} at some level around the print() call then you're safe. Stas suggested =
doing that as far back as 2005 when the same error was reported: =
http://marc.info/?l=3Dapache-modperl&m=3D112347961618748&w=3 D2.
And with SVN rev. 1052232 in place you can even now filter out lost =
connection errors and write an error page back in other cases where it =
is safe to do so.
My point here is that print() failures can (and must be!) caught and =
handled appropriately, whereas the troublesome flush failures seem to =
happen at a later stage and are not caught even by an all-encompassing =
eval { }, hence mod_perl should not be throwing those.
In fact, given that these flush failures apparently can't be caught, =
perhaps flush should never throw an exception? I've changed it so that =
it just logs lost connection errors rather than throwing an exception, =
but if any other kind of error occurs then it will still throw. I've =
never seen any other cause of flush failing in the wild, though, so =
perhaps if any other kind of error occurs then it really is an =
exceptional situation?
However, since I've also not been able to reproduce the problem myself =
and therefore don't fully understand what is happening, I've taken the =
approach of applying the least changes necessary to fix the problem.
(I even wonder about the whole style of throwing exceptions from the I/O =
code, in particular the PerlIO layer implemented in modperl_io_apache.c: =
the PerlIO manual (perliol.pod) talks of returning NULL or -1 from most =
functions to indicate failure, not throwing exceptions... The downside =
to that, though, is that it forces you to check the return value of =
every print() call, whereas if it throws an exception instead then you =
can lazily ignore it (it *is* generally unlikely to fail, after all), =
knowing that your all-encompassing eval { } will catch it if it does go =
wrong.)
Re: APR does not understand this error code
am 25.05.2011 11:41:48 von Thomas den Braber
On May 26, 2011 09:36 Torsten wrote:
>
> Since I haven't heard from you I take it the problem has been resolved,
> has it? Did you try Steve's patch?
>
I have done a lot of testing on many different systems but still haven't
figured it out exactly when the problem occurs. I have found that on
windows 7 64 bit and 2008 64 bit with Perl 5.12 and apache 2.17 from
apachelounge the problem is NOT seen.
I was only able to reproduce the problem on windows 2003 and 2008 R1
server 32 bit. But even here it was very difficult to reproduce it in a
situation where Apache actually restarted.
I found that there where two occasions of the APR error.
One that gives the real line number where the problem occurred:
'APR does not understand this error code at /path/module line xxx'
This does not course the Apache to restart.
The other error is:
'Apache2 IO flush: (620018) APR does not understand this error code at -e
line 0'.
This causes Apache to restart.
The first error is seen in the log of the virtual host that runs the
ModPerl script. The other error is seen in the main apache error log file.
Any Idea what 'at -e' means ?
I have not tried Steve's patch yet, will do that asap.
Will be continued ..
--
Thomas den Braber