crash on Perlbal 1.51

Mike Whitaker mike at altrion.org
Thu Nov 30 10:40:02 UTC 2006


On 30 Nov 2006, at 08:49, Kevin Rosenberg wrote:

> Del Raco wrote:
>> I understand the first hack.  Can you elaborate on the
>> second one?
>> [...]
>>> +    return if ref $client eq
>>> "Perlbal::ClientHTTPBase";
>>> +
>>>      # if our client's behind more than the max
>>> limit, stop buffering
>>>      if ($client->too_far_behind_backend) {
>>>          $self->watch_read(0);
>
> The method too_far_behind_backend is sometimes called with $client
> containing a Perlbal::ClientHTTPBase object which does not have that
> method. So, it causes Perlbal to crash. It's a rather braindead
> workaround the crash.

Might I suggest that:

if ($client->can('too_far_behind_backend') && $client- 
 >too_far_behind_backend)

might be a little more elegant and robust in the face of other  
objects with a similar problem suddenly appearing? :)


More information about the perlbal mailing list