Ignore AnyEvent::Handler->push_write errors to prevent broken pipe error #39

Open
wants to merge 1 commit into
from

Projects

None yet

1 participant

@dex4er
dex4er commented Jan 2, 2014

Twiggy with Plack::App::Proxy:

#!/usr/bin/env twiggy

use Plack::Builder;
use Plack::App::Proxy;

builder {
    enable 'AccessLog';
    enable 'Proxy::Connect';
    enable 'Proxy::AddVia';
    enable 'Proxy::Requests';
    Plack::App::Proxy->new->to_app;
};

It fails often with following error:

127.0.0.1 - - [30/Dec/2013:22:55:16 +0100] "GET http://i.wp.pl/a/i/program_tv/logotypy/tv4.jpg HTTP/1.1" 200 - "http://tv.wp.pl/?ticaid=111ef7" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36"
AnyEvent::Handle uncaught error: Broken pipe at /home/dexter/perl5/perlbrew/perls/perl-5.18.1/lib/site_perl/5.18.1/Twiggy/Server.pm line 604.

It seems that this patch prevents Twiggy crashes.

@dex4er
dex4er commented Jan 29, 2014

I'm afraid this is not enough. Still getting:

AnyEvent::Handle uncaught error: Broken pipe at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent/Loop.pm line 248.

Perhaps missing some "on_error"

@dex4er
dex4er commented Feb 3, 2014

I've got stack trace:

AnyEvent::Handle uncaught error: Przerwany potok at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent/Handle.pm line 642
    Carp::croak("AnyEvent::Handle uncaught error: Przerwany potok") called in package AnyEvent::Handle at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent/Handle.pm line 642
    AnyEvent::Handle::_error("AnyEvent::Handle::destroyed=HASH(0x173cdf0)", "Przerwany potok", 1) called in package AnyEvent::Handle at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent/Handle.pm line 962
    AnyEvent::Handle::__ANON__() called in package AnyEvent::Loop at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent/Loop.pm line 248
    AnyEvent::Loop::one_event() called in package AnyEvent::Impl::Perl at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent/Impl/Perl.pm line 46
    AnyEvent::CondVar::Base::_wait("AnyEvent::CondVar=HASH(0x151a3b8)") called in package AnyEvent::CondVar::Base at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/x86_64-linux-thread-multi/AnyEvent.pm line 1992
    AnyEvent::CondVar::Base::recv("AnyEvent::CondVar=HASH(0x151a3b8)") called in package Twiggy::Server at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Twiggy/Server.pm line 592
    Twiggy::Server::run("Twiggy::Server=HASH(0x1178b50)", "CODE(0xa65e30)") called in package Plack::Handler::Twiggy at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Plack/Handler/Twiggy.pm line 17
    Plack::Handler::Twiggy::run("Plack::Handler::Twiggy=HASH(0x9678f8)", "CODE(0xa65e30)") called in package Plack::Loader at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Plack/Loader.pm line 84
    Plack::Loader::run("Plack::Loader=HASH(0xa4d430)", "Plack::Handler::Twiggy=HASH(0x9678f8)") called in package Plack::Runner at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Plack/Runner.pm line 277
    Plack::Runner::run("Plack::Runner=HASH(0x7d3190)") called in package main at /home/dexter/perl5/perlbrew/perls/perl-5.18.2/bin/twiggy line 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment