Skip Menu |

This queue is for tickets about the Hijk CPAN distribution.

Report information
The Basics
Id: 101424
Status: resolved
Priority: 0/
Queue: Hijk

People
Owner: Nobody in particular
Requestors: michael.smith [...] dianomi.com
michael.stevens [...] dianomi.com
MSTEVENS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.18
Fixed in: (no value)



Subject: Requests intermittently fail with 0 byte response error
Hi, I'm trying out Hijk. I intermittently get this as the response: $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a 0 byte response for http head. This shouldn\\'t happen',\n 'status' => 0,\n 'error' => 64\n }; Since this sounds like an internal error, I'm reporting it as a bug. Hijk is 0.18, perl is: Summary of my perl5 (revision 5 version 12 subversion 2) configuration: Platform: osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Jan 11 2011 13:45:15 @INC: /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux /opt/dianomi/perl/lib/site_perl/5.12.2 /opt/dianomi/perl/lib/5.12.2/x86_64-linux /opt/dianomi/perl/lib/5.12.2 .
Subject: Re: [rt.cpan.org #101424] Requests intermittently fail with 0 byte response error
Date: Fri, 9 Jan 2015 12:28:55 +0100
To: bug-Hijk [...] rt.cpan.org
From: Ævar Arnfjörð Bjarmason <avarab [...] gmail.com>
Do you have more details than that? What are you making requests against? What does the request code look like? Does disabling the connection cache make it go away? On 9 Jan 2015 12:03, "Michael Stevens via RT" <bug-Hijk@rt.cpan.org> wrote: Show quoted text
> Fri Jan 09 06:02:58 2015: Request 101424 was acted upon. > Transaction: Ticket created by MSTEVENS > Queue: Hijk > Subject: Requests intermittently fail with 0 byte response error > Broken in: 0.18 > Severity: (no value) > Owner: Nobody > Requestors: MSTEVENS@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101424 > > > > Hi, > > I'm trying out Hijk. > > I intermittently get this as the response: > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a 0 > byte response for http head. This shouldn\\'t happen',\n 'status' > => 0,\n 'error' => 64\n }; > > Since this sounds like an internal error, I'm reporting it as a bug. > > Hijk is 0.18, perl is: > > Summary of my perl5 (revision 5 version 12 subversion 2) configuration: > > Platform: > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp fri > oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > hint=recommended, useposix=true, d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include' > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 > libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.5' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib > -fstack-protector' > > > Characteristics of this binary (from libperl): > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > USE_64_BIT_ALL > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > USE_PERL_ATOF > Built under linux > Compiled at Jan 11 2011 13:45:15 > @INC: > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/site_perl/5.12.2 > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/5.12.2 > . > >
On Fri Jan 09 06:02:58 2015, MSTEVENS wrote: Show quoted text
> Hi, > > I'm trying out Hijk. > > I intermittently get this as the response: > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a > 0 byte response for http head. This shouldn\\'t happen',\n > 'status' => 0,\n 'error' => 64\n }; > > Since this sounds like an internal error, I'm reporting it as a bug. > > Hijk is 0.18, perl is: > > Summary of my perl5 (revision 5 version 12 subversion 2) > configuration: > > Platform: > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp > fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > hint=recommended, useposix=true, d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack- > protector -I/usr/local/include -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include' > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 > /usr/local/lib64 my $res = Hijk::request({
method => "GET", host => $server_ip, port => $server_port, path => $self->{gds_base} . $ip, connect_timeout => 5, read_timeout => 5, }); Show quoted text
> libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.5' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack- > protector' > > > Characteristics of this binary (from libperl): > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > USE_64_BIT_ALL > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > USE_PERL_ATOF > Built under linux > Compiled at Jan 11 2011 13:45:15 > @INC: > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/site_perl/5.12.2 > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/5.12.2 > .
The request code looks like this: my $res = Hijk::request({ method => "GET", host => $server_ip, port => $server_port, path => $self->{gds_base} . $ip, connect_timeout => 5, read_timeout => 5, }); It's mainly running in mod_perl on apache, although I have seen the error 1 time outside apache. It's connecting to a proprietary app running on tomcat 7. I just wrote a smallish test case. Testing 1000 successive requests in 1 process, I get 9 errors.
On Fri Jan 09 06:02:58 2015, MSTEVENS wrote: Show quoted text
> Hi, > > I'm trying out Hijk. > > I intermittently get this as the response: > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a > 0 byte response for http head. This shouldn\\'t happen',\n > 'status' => 0,\n 'error' => 64\n }; > > Since this sounds like an internal error, I'm reporting it as a bug. > > Hijk is 0.18, perl is: > > Summary of my perl5 (revision 5 version 12 subversion 2) > configuration: > > Platform: > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp > fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > hint=recommended, useposix=true, d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack- > protector -I/usr/local/include -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include' > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 > /usr/local/lib64 > libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.5' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack- > protector' > > > Characteristics of this binary (from libperl): > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > USE_64_BIT_ALL > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > USE_PERL_ATOF > Built under linux > Compiled at Jan 11 2011 13:45:15 > @INC: > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/site_perl/5.12.2 > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/5.12.2 > .
I found a much simpler test case: #!/opt/dianomi/perl/bin/perl -w use strict; use warnings; use Hijk; use Data::Dumper; for (my $i = 0; $i < 1000; $i++) { my $res = Hijk::request({ method => "GET", host => "www.etla.org", port => "80", path => "/", connect_timeout => 5, read_timeout => 5, }); if ($res->{status} != 200) { print Dumper($res); } } will trigger 5-10 failures.

Message body is not shown because it is too large.

On 2015-01-09T08:43:10-05:00, MSTEVENS wrote: Show quoted text
> On Fri Jan 09 06:02:58 2015, MSTEVENS wrote:
> > Hi, > > > > I'm trying out Hijk. > > > > I intermittently get this as the response: > > > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a > > 0 byte response for http head. This shouldn\\'t happen',\n > > 'status' => 0,\n 'error' => 64\n }; > > > > Since this sounds like an internal error, I'm reporting it as a bug. > > > > Hijk is 0.18, perl is: > > > > Summary of my perl5 (revision 5 version 12 subversion 2) > > configuration: > > > > Platform: > > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp > > fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > > hint=recommended, useposix=true, d_sigaction=define > > useithreads=undef, usemultiplicity=undef > > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > > use64bitint=define, use64bitall=define, uselongdouble=undef > > usemymalloc=n, bincompat5005=undef > > Compiler: > > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack- > > protector -I/usr/local/include -D_LARGEFILE_SOURCE > > -D_FILE_OFFSET_BITS=64', > > optimize='-O2', > > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > > -I/usr/local/include' > > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > > gccosandvers='' > > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > > lseeksize=8 > > alignbytes=8, prototype=define > > Linker and Libraries: > > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 > > /usr/local/lib64 > > libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > > gnulibc_version='2.5' > > Dynamic Linking: > > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack- > > protector' > > > > > > Characteristics of this binary (from libperl): > > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > > USE_64_BIT_ALL > > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > > USE_PERL_ATOF > > Built under linux > > Compiled at Jan 11 2011 13:45:15 > > @INC: > > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > > /opt/dianomi/perl/lib/site_perl/5.12.2 > > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > > /opt/dianomi/perl/lib/5.12.2 > > .
> > I found a much simpler test case: > > #!/opt/dianomi/perl/bin/perl -w > > use strict; > use warnings; > use Hijk; > use Data::Dumper; > > for (my $i = 0; $i < 1000; $i++) { > my $res = Hijk::request({ > method => "GET", > host => "www.etla.org", > port => "80", > path => "/", > connect_timeout => 5, > read_timeout => 5, > }); > > if ($res->{status} != 200) { > print Dumper($res); > } > } > > will trigger 5-10 failures.
Thanks. I'm able to reproduce this. I'll look into it over the weekend.
On 2015-01-09T12:10:28-05:00, AVAR wrote: Show quoted text
> On 2015-01-09T08:43:10-05:00, MSTEVENS wrote:
> > On Fri Jan 09 06:02:58 2015, MSTEVENS wrote:
> > > Hi, > > > > > > I'm trying out Hijk. > > > > > > I intermittently get this as the response: > > > > > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > > > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a > > > 0 byte response for http head. This shouldn\\'t happen',\n > > > 'status' => 0,\n 'error' => 64\n }; > > > > > > Since this sounds like an internal error, I'm reporting it as a bug. > > > > > > Hijk is 0.18, perl is: > > > > > > Summary of my perl5 (revision 5 version 12 subversion 2) > > > configuration: > > > > > > Platform: > > > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > > > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp > > > fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > > > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > > > hint=recommended, useposix=true, d_sigaction=define > > > useithreads=undef, usemultiplicity=undef > > > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > > > use64bitint=define, use64bitall=define, uselongdouble=undef > > > usemymalloc=n, bincompat5005=undef > > > Compiler: > > > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack- > > > protector -I/usr/local/include -D_LARGEFILE_SOURCE > > > -D_FILE_OFFSET_BITS=64', > > > optimize='-O2', > > > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > > > -I/usr/local/include' > > > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > > > gccosandvers='' > > > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > > > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > > > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > > > lseeksize=8 > > > alignbytes=8, prototype=define > > > Linker and Libraries: > > > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > > > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 > > > /usr/local/lib64 > > > libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > > > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > > > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > > > gnulibc_version='2.5' > > > Dynamic Linking: > > > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > > > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack- > > > protector' > > > > > > > > > Characteristics of this binary (from libperl): > > > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > > > USE_64_BIT_ALL > > > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > > > USE_PERL_ATOF > > > Built under linux > > > Compiled at Jan 11 2011 13:45:15 > > > @INC: > > > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > > > /opt/dianomi/perl/lib/site_perl/5.12.2 > > > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > > > /opt/dianomi/perl/lib/5.12.2 > > > .
> > > > I found a much simpler test case: > > > > #!/opt/dianomi/perl/bin/perl -w > > > > use strict; > > use warnings; > > use Hijk; > > use Data::Dumper; > > > > for (my $i = 0; $i < 1000; $i++) { > > my $res = Hijk::request({ > > method => "GET", > > host => "www.etla.org", > > port => "80", > > path => "/", > > connect_timeout => 5, > > read_timeout => 5, > > }); > > > > if ($res->{status} != 200) { > > print Dumper($res); > > } > > } > > > > will trigger 5-10 failures.
> > Thanks. I'm able to reproduce this. I'll look into it over the weekend.
It turns out that this was a major regression in the 0.16 release. The reason you were getting intermittent errors is because we weren't properly supporting the server sending Connection: close since then. That now works again with the 0.19 release I just pushed. Details & patch at https://github.com/gugod/Hijk/commit/252a9d07946cf4533fafa12884a2a1d2ea474013
Subject: RE: [rt.cpan.org #101424] Requests intermittently fail with 0 byteresponse error
Date: Mon, 12 Jan 2015 07:23:07 +0000
To: <bug-Hijk [...] rt.cpan.org>, <MSTEVENS [...] cpan.org>, <michael.smith [...] dianomi.com>
From: Michael Stevens <michael.stevens [...] dianomi.com>
Thanks, I will retest. Show quoted text
-----Original Message----- From: "AEvar Arnfjord Bjarmason via RT" <bug-Hijk@rt.cpan.org> Sent: ‎10/‎01/‎2015 17:18 To: "MSTEVENS@cpan.org" <MSTEVENS@cpan.org>; "michael.smith@dianomi.com" <michael.smith@dianomi.com>; "michael.stevens@dianomi.com" <michael.stevens@dianomi.com> Subject: [rt.cpan.org #101424] Requests intermittently fail with 0 byteresponse error <URL: https://rt.cpan.org/Ticket/Display.html?id=101424 > On 2015-01-09T12:10:28-05:00, AVAR wrote:
> On 2015-01-09T08:43:10-05:00, MSTEVENS wrote:
> > On Fri Jan 09 06:02:58 2015, MSTEVENS wrote:
> > > Hi, > > > > > > I'm trying out Hijk. > > > > > > I intermittently get this as the response: > > > > > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > > > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a > > > 0 byte response for http head. This shouldn\\'t happen',\n > > > 'status' => 0,\n 'error' => 64\n }; > > > > > > Since this sounds like an internal error, I'm reporting it as a bug. > > > > > > Hijk is 0.18, perl is: > > > > > > Summary of my perl5 (revision 5 version 12 subversion 2) > > > configuration: > > > > > > Platform: > > > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > > > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp > > > fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > > > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > > > hint=recommended, useposix=true, d_sigaction=define > > > useithreads=undef, usemultiplicity=undef > > > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > > > use64bitint=define, use64bitall=define, uselongdouble=undef > > > usemymalloc=n, bincompat5005=undef > > > Compiler: > > > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack- > > > protector -I/usr/local/include -D_LARGEFILE_SOURCE > > > -D_FILE_OFFSET_BITS=64', > > > optimize='-O2', > > > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > > > -I/usr/local/include' > > > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > > > gccosandvers='' > > > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > > > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > > > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > > > lseeksize=8 > > > alignbytes=8, prototype=define > > > Linker and Libraries: > > > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > > > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 > > > /usr/local/lib64 > > > libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > > > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > > > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > > > gnulibc_version='2.5' > > > Dynamic Linking: > > > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > > > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack- > > > protector' > > > > > > > > > Characteristics of this binary (from libperl): > > > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > > > USE_64_BIT_ALL > > > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > > > USE_PERL_ATOF > > > Built under linux > > > Compiled at Jan 11 2011 13:45:15 > > > @INC: > > > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > > > /opt/dianomi/perl/lib/site_perl/5.12.2 > > > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > > > /opt/dianomi/perl/lib/5.12.2 > > > .
> > > > I found a much simpler test case: > > > > #!/opt/dianomi/perl/bin/perl -w > > > > use strict; > > use warnings; > > use Hijk; > > use Data::Dumper; > > > > for (my $i = 0; $i < 1000; $i++) { > > my $res = Hijk::request({ > > method => "GET", > > host => "www.etla.org", > > port => "80", > > path => "/", > > connect_timeout => 5, > > read_timeout => 5, > > }); > > > > if ($res->{status} != 200) { > > print Dumper($res); > > } > > } > > > > will trigger 5-10 failures.
> > Thanks. I'm able to reproduce this. I'll look into it over the weekend.
It turns out that this was a major regression in the 0.16 release. The reason you were getting intermittent errors is because we weren't properly supporting the server sending Connection: close since then. That now works again with the 0.19 release I just pushed. Details & patch at https://github.com/gugod/Hijk/commit/252a9d07946cf4533fafa12884a2a1d2ea474013
On Fri Jan 09 06:02:58 2015, MSTEVENS wrote: Show quoted text
> Hi, > > I'm trying out Hijk. > > I intermittently get this as the response: > > $VAR1 = {\n 'body' => undef,\n 'head' => undef,\n > 'proto' => undef,\n 'error_message' => 'Wasn\\'t expecting a > 0 byte response for http head. This shouldn\\'t happen',\n > 'status' => 0,\n 'error' => 64\n }; > > Since this sounds like an internal error, I'm reporting it as a bug. > > Hijk is 0.18, perl is: > > Summary of my perl5 (revision 5 version 12 subversion 2) > configuration: > > Platform: > osname=linux, osvers=2.6.18-194.26.1.el5, archname=x86_64-linux > uname='linux 303646-web1.dianomi.co.uk 2.6.18-194.26.1.el5 #1 smp > fri oct 29 14:21:16 edt 2010 x86_64 x86_64 x86_64 gnulinux ' > config_args='-des -Dprefix=/opt/dianomi/perl -Accflags=-fPIC' > hint=recommended, useposix=true, d_sigaction=define > useithreads=undef, usemultiplicity=undef > useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-fPIC -fno-strict-aliasing -pipe -fstack- > protector -I/usr/local/include -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64', > optimize='-O2', > cppflags='-fPIC -fno-strict-aliasing -pipe -fstack-protector > -I/usr/local/include' > ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-48)', > gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 > /usr/local/lib64 > libs=-lnsl -ldb -ldl -lm -lcrypt -lutil -lc > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc > libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a > gnulibc_version='2.5' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' > cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack- > protector' > > > Characteristics of this binary (from libperl): > Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP > USE_64_BIT_ALL > USE_64_BIT_INT USE_LARGE_FILES USE_PERLIO > USE_PERL_ATOF > Built under linux > Compiled at Jan 11 2011 13:45:15 > @INC: > /opt/dianomi/perl/lib/site_perl/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/site_perl/5.12.2 > /opt/dianomi/perl/lib/5.12.2/x86_64-linux > /opt/dianomi/perl/lib/5.12.2 > .
my test case now succeeds