Mailing List Archive

Apache Reload Caveat
[. note: i sent this earlier, then realized that i sent it from an
unsubscribed address. i'm resending because i can't remember if
unregistered messages are /dev/nulled or admined in ]

I'm not submitting this as a patch, as I don't know how to properly
word this.

It's pretty much a variation of the following issue, but has to do
with class inheritance

http://perl.apache.org/docs/2.0/api/Apache2/
Reload.html#toc_Problems_with_Scripts_Running_with_Registry_Handlers_tha
t_Cache_the_Code

if you subclass a module to override a few methods, and then decide
to remove a subclassed method (to call off the method in the parent
class instead), you will raise an error instead of calling the parent
method.
if you do a restart, everything works as expected.

to note - this happens in mod_perl handlers -- ( i didn't test under
registry, i'd imagine its the same )

case:
==============

package MyUtils;
sub color { "white" }
1;

package MyUtils::Customized;
sub color { "red" }
1;

sub handler{
my $object = My::Utils::Customized->new();
$r->print( "The color is " . $object->color() )
}

================

returns :
"The color is red"

Now we change My::Utils::Customized;
- sub color { "red" }

And we see:
"Not a code reference at xxxxx "

Restarting Apache we will see as we expect
"The color is white"


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Apache Reload Caveat [ In reply to ]
On Thu, 2006-03-30 at 18:34 -0500, Jonathan Vanasco wrote:
> if you subclass a module to override a few methods, and then decide
> to remove a subclassed method (to call off the method in the parent
> class instead), you will raise an error instead of calling the parent
> method.
> if you do a restart, everything works as expected.

Perl caches method lookups in order to reduce the performance hit of OO
code. If you'd like to make a patch for the A::Reload docs saying that
it can't handle changes that modify which package a method should be
called in, I think that's close enough.

- Perrin


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Apache Reload Caveat [ In reply to ]
On Mar 30, 2006, at 6:42 PM, Perrin Harkins wrote:

> On Thu, 2006-03-30 at 18:34 -0500, Jonathan Vanasco wrote:
>> if you subclass a module to override a few methods, and then decide
>> to remove a subclassed method (to call off the method in the parent
>> class instead), you will raise an error instead of calling the parent
>> method.
>> if you do a restart, everything works as expected.
>
> Perl caches method lookups in order to reduce the performance hit
> of OO
> code. If you'd like to make a patch for the A::Reload docs saying
> that
> it can't handle changes that modify which package a method should be
> called in, I think that's close enough.
>
> - Perrin


OK. I'll do that and quote from above. Thanks.



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org
Re: Apache Reload Caveat [ In reply to ]
Attached is a documentation patch that mixes:
my description/example
perrin's explanation

To the Apache2::Reload class inheritance issue i noted.

It *may* be rendered obsolete by a patch the Philip Gollucci
authored, but I can't free up a machine to test his patch until early
next week.
Re: Apache Reload Caveat [ In reply to ]
Jonathan Vanasco wrote:
> Attached is a documentation patch that mixes:
> my description/example
> perrin's explanation
>
> To the Apache2::Reload class inheritance issue i noted.
>
> It *may* be rendered obsolete by a patch the Philip Gollucci authored,
> but I can't free up a machine to test his patch until early next week.
I didn't author that patch... I'm not even enirely sure I've gotten around
to committing it... Though Gozer might have.

I'll dig into this at some point.


Oooh what I wouldn't give for time-suspension machine.

--
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F 6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org