Re: Flakey behavior

[prev] [thread] [next] [Date index for 2004/11/14]

From: Stas Bekman
Subject: Re: Flakey behavior
Date: 03:56 on 14 Nov 2004
David Dyer-Bennet wrote:
> David Dyer-Bennet <dd-b@xxxx.xxx> writes:
> 
> 
>>I'm running into flakoid behavior in a script that uses Image::EXIF to
>>read file information under mod_perl (via Apache::Registry).
>>Sometimes, without throwing any error or setting the internal error
>>variable, Image::EXIF reads nothing from the file.  I can't correlate
>>it with anything; a random string of reloads will start producing
>>different results at a random point. 
> 
> 
> Not solved yet; but setting the same script up as a CGI instead
> (i.e. copying into /cgi-bin/), it works fine; whatever the problem is
> it's definitely caused by running under mod_perl.  
> 
> And now that I'm not changing the script so often, I see that it seems
> to always (nearly always?) run correctly the first time after I change
> it, and after that it mostly finds null EXIF data.  I see a very
> *very* rare case where it comes up with the right data, so it's not
> 100.00% failure on reload, but it's close. 
> 
> Still looking for clues!

David, take a look at:
http://perl.apache.org/docs/1.0/guide/debug.html#Debugging_your_code_in_Single_Server_Mode
to avoid guessing. If you have a problem in your code, you will see it 
immediately on the second request.

Most likely it's the fault of the module that you are using. Perhaps it 
wasn't written in mind to run under mod_perl. I'd look there first. Look 
for globals first. Then see if there are initialized on each request. My 
guess is that this is your problem. Under mod_cgi you can't see that since 
there is no interpreter persistance. Take some time to read:
http://perl.apache.org/docs/1.0/guide/porting.html#Global_Variables_Persistence

        -- 
        __________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@xxxxxx.xxx http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Flakey behavior
David Dyer-Bennet 04:36 on 13 Nov 2004

Re: Flakey behavior
David Dyer-Bennet 22:16 on 13 Nov 2004

Re: Flakey behavior
Stas Bekman 03:56 on 14 Nov 2004

Re: Flakey behavior
David Dyer-Bennet 05:16 on 14 Nov 2004

Generated at 11:27 on 21 Dec 2004 by mariachi v0.52