On Wed, Sep 8, 2010 at 2:08 PM, Bill Moseley <[email protected]> wrote:

> The problem I have with this code is that requests can trigger an error on
> demand.  Errors eventually trigger an email to a bunch of people. But it's
> for an error nobody can fix.
>

"Wrong Content-Length value: $length"

I've received hundreds of these in the last day.  Many seem to be AJAX
requests (many PUTs) which makes me wonder if there's some broken clients
that are failing to send the body.  Also, a lot of OPTIONS request.  And
some I suspect are people fooling around as I see content lengths like 55,
555, 55555 from the same IP address for the same request in a short amount
of time.

I use Log4perl and send "error" level messages off to a separate file which
then a cron job will mail off every few minutes.  I can filter them by
adding regular expressions to my config which downgrades the message to a
warn, but I have to push out new config to all the web servers.

I need a smarter system where the logs get filtered by an external process
that can be updated dynamically with filters.  After I see 100 similar
messages I can probably afford to suppress that message so other more
important messages don't get lost in the noise.

Anyone have a system that does something like that?





>
>         # paranoia against wrong Content-Length header
>         my $remaining = $length - $self->read_position;
>         if ( $remaining > 0 ) {
>             $self->finalize_read($c);
>             Catalyst::Exception->throw(
>                 "Wrong Content-Length value: $length" );
>         }
>
> Shouldn't that just return 411, 413, or just a 400?
>
> And then there's:
>      eval {
>       ....
>     };
>
>     if ( my $error = $@ ) {
>         chomp $error;
>         $class->log->error(qq/Caught exception in engine "$error"/);
>     }
>
> Should check return value from eval instead.
>
>
>
> --
> Bill Moseley
> [email protected]
>



-- 
Bill Moseley
[email protected]
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to