using MOD_PERL with script causes looping
am 10.09.2008 22:22:55 von csross
On a solaris 8 server with Apache 2.6 and perl 5.8.8, we have an
html/javascript file that uses HTTP Post to a perl script. The perl script
sends data back via HTTP get to a redirected HTML file. The HTML file strips
off data from the command line of the URL (suff after the "?") and then
posts more data to the perl script until all of the data it needs is
retreived. This works fine in perl without mod-perl enabled, but loops in
modperl, as if the initial connection for the first request is still open
and the same data is being endlessly sent back. This happens on later
versions of Solaris as well.
We did find that after what seems like many interations of the looping, the
data finally get processed and the subsequent screen appears, but that is
after a minute at least. When not using mod_perl, this doesn't happen. The
developer wanted to put in a "wait" type command to see if that worked, but
it did not make a difference.
Has anyone seen this type of behavior?
Thank you very much
--
View this message in context: http://www.nabble.com/using-MOD_PERL-with-script-causes-loop ing-tp19422410p19422410.html
Sent from the mod_perl - General mailing list archive at Nabble.com.
Re: using MOD_PERL with script causes looping
am 11.09.2008 10:53:19 von torsten.foertsch
On Wed 10 Sep 2008, csross wrote:
> On a solaris 8 server with Apache 2.6 and perl 5.8.8, we have an
> html/javascript file that uses HTTP Post to a perl script. =A0The perl
> script sends data back via HTTP get to a redirected HTML file. The
> HTML file strips off data from the command line of the URL (suff
> after the "?") and then posts more data to the perl script until all
> of the data it needs is retreived. This works fine in perl without
> mod-perl enabled, but loops in modperl, as if the initial connection
> for the first request is still open and the same data is being
> endlessly sent back. =A0This happens on later versions of Solaris as
> well.
>
> We did find that after what seems like many interations of the
> looping, the data finally get processed and the subsequent screen
> appears, but that is after a minute at least. =A0When not using
> mod_perl, this doesn't happen. =A0The developer wanted to put in a
> "wait" type command to see if that worked, but it did not make a
> difference.
>
> Has anyone seen this type of behavior?
I think the reason is that the perl script holds some status. The=20
difference between mod_perl and CGI is that the former uses the same=20
interpreter again and again while the latter starts the interpreter=20
anew each time. So, if the script doesn't clean up things properly it=20
may look different for the second request.
You probably also use KeepAlive requests. That would explain the fact=20
that it worked after many requests. Either the server or the browser=20
has dropped the connection. The browser then establishes a new one and=20
probably hits another perl interpreter. That one is still in pristine=20
state. Hence it worked.
Torsten
=2D-
Need professional mod_perl support?
Just hire me: torsten.foertsch@gmx.net