Re: [Persistentperl-users] Indefinite wait on first pass through?
Brought to you by:
samh
|
From: Joel P. <pl...@ej...> - 2003-02-14 17:52:41
|
Hi Sam,
Todd & I have narrowed down the issue a bit, but we could still use your advice. We added
timing/debug/log statements to our core software and it revealed a few things. It is not really an
Oracle issue. I think it is more related to how we get and process the CGI request and if our main
program should ever exit(0)? Here's what we've found:
1) background info: a small version of our code is:
#!/usr/bin/perperl -X -- -M1 -t604800
MAIN:
{
&log("step1");
$query = new CGI;
&log("step2");
&process_request();
&log("step3");
# exit(0);
}
sub process_request
{
.... our main application here...
}
where process_request(); is the bulk of our program.
It flies through steps 1,2,3 within 1-3 seconds.... then after step3, it hangs for 5 minutes... if we
add the exit(0), it still hangs...
If we recraft the code to be:
MAIN:
{
&log("step1");
while(1) {
$query = new CGI;
&log("step2");
&process_request();
&log("step3");
}
}
Then it processes the first request over & over again, but really quickly....
If we recraft the code to be:
MAIN:
{
&log("step1");
while($query = new CGI) {
&log("step2");
&process_request();
&log("step3");
}
}
Then it takes the long time to process even the first request...
My guess is that we should be putting this into a loop or not using "new CGI" but using something like
CGI::Request() or something. Can you e-mail us a 5 line sample script on what you had in mind? I'm
sure it's some confusion about how the main loop should either poll forever, or exit and what CGI::
method you (the perperl code) is expecting us to use.
Many thanks,
Joel
______________________________________
Joel Plotkin
eJournalPress
http://www.ejournalpress.com
301-254-5900
301-564-4006 (fax)
|