Forum Moderators: open

Message Too Old, No Replies

Popup problem in javascript/perl

         

RajathM

7:19 am on Sep 15, 2008 (gmt 0)

10+ Year Member



Hi Team,

I am facing timeout problem while using popup window.

i have perl script, in form field i am executing .cgi script and calling validate() function on submit. the validate function is implemented using javascript which creats popup window.

The popup window is giving "Page cannot be displayed" message after exactly 60 minutes,my .cgi takes around 90 minutes to complete.now User thinks operation is terminated how to resolve this issue?
can any one help on this issue.

Thanks & Regards
RajathM

rocknbil

8:19 pm on Sep 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome aboard RajathM! First you have to determine if this is a problem with the Javascript or your perl script.

90 minutes is unbelievable. Somewhere you have to have a recursive function or you're on the world's worse web server. I'd approach this first by eliminating Javascript entirely in a test form. Post directly to a test version of the perl script.

If this fixes it, go back to your Javascript and begin adding alerts:

function validate () {
for (i=0;i<validation_list;i++) {
alert(validation_list[i]);
}
}

If it still hangs after eliminating Javascript, go into your perl script and begin adding print statements. Start with this at the top:

print "content-type:text/html\n\n";

Then throughout the script, add something like this at key points:

print "top of script<br>\n";
....
print "read/parse<br>\n";
....
print "validate function<br>\n";
....
print "input to database<br>\n";

And so on. Find the problem first, then you know where to look.

RajathM

6:46 am on Sep 16, 2008 (gmt 0)

10+ Year Member



Thanks for your information rocknbil.

there is no such recursive function in my script.
i told in that form action i am calling one .cgi script wich in tern calls one .sh script it is doing tar operation of some big file, so it is taking that much time.

waiting for ur reply

Regards
rajathM

rocknbil

3:20 pm on Sep 16, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In that case, I suggest looking into using the fork function from perl.

if ($pid = fork) { &return_html_response; }
# Spawn child process
else { &perform_intensive_function; }

Fork spawns the child process, allowing it to run in the background, while the parent process immediately returns a response to the browser.

RajathM

4:43 am on Sep 17, 2008 (gmt 0)

10+ Year Member



Thanks for your information.
I am working arround the idea given you.