Giter VIP home page Giter VIP logo

net--rabbitmq's People

Contributors

2shortplanks avatar aschrab avatar awick avatar clintongormley avatar eserte avatar jpfrigerio avatar neophenix avatar postwait avatar redhotpenguin avatar timblair avatar viliampucik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

net--rabbitmq's Issues

Missing documentation for get() method

The "get()" method is missing documentation.

Its says:

$options is an optional hash respecting the following keys:

But there is no hash following that line.

basic_return returns no data about the original request

Hiya

Would it be possible to add the original message body into the basic return callback arguments?

Because the basic_return callback is only called when the connection is flushed (either by disconnecting or closing a channel), there is no way I can associate the failures with the original message, so although I am aware that there has been a problem, I've lost my message and can't handle failure gracefully.

thanks

clint

0.2.6 Test failures (possibly dev.rabbitmq.com related)

This is essentially a duplicate of https://rt.cpan.org/Public/Bug/Display.html?id=85313 but i don't see it amongst the github issues here, hence...

Net::RabbitMQ 0.2.6 is failing its tests. I have tried this with perl 5.10.1, 5.16.3 and 5.18.0. We already have version 0.2.6 installed with our system perl (5.10.1) so i am assuming that this worked in the past. When trying to re-build with the same perl the same tests also fail. My assumption is that this is something to do with dev.rabbitmq.com rather than Net::RabbitMQ itself.

===== make test =====

PERL_DL_NONLAZY=1 /var/www/tools/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t                                                                                                                                              [1/92632]
t/001_declare_exchange.t ............ ok
t/002_publish.t ..................... ok
t/003_consume.t ..................... 5/7 Died at t/003_consume.t line 20.
# Looks like you planned 7 tests but ran 5.
# Looks like your test exited with 4 just after 5.
t/003_consume.t ..................... Dubious, test returned 4 (wstat 1024, 0x400)
Failed 2/7 subtests
t/004_selfconsume.t ................. ok
t/005_noack.t ....................... ok
t/006_txn.t ......................... ok
t/007_get.t ......................... 10/13
#   Failed test 'get'
#   at t/007_get.t line 64.
#          got: 'basic_get: server channel error 406, message: PRECONDITION_FAILED - invalid expiration 'later': no_integer at t/007_get.t line 63.
# '
#     expected: ''

#   Failed test 'get should see message'
#   at t/007_get.t line 67.
#     Structures begin differing at:
#          $got->{body} = 'Magic Transient Payload'
#     $expected->{body} = 'Magic Transient Payload 2'
# Looks like you failed 2 tests of 13.
t/007_get.t ......................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/13 subtests
t/008_queue_declare.t ............... ok
t/009_no_route.t .................... 4/10 Closing connection: server connection error 540, message: NOT_IMPLEMENTED - immediate=true at t/009_no_route.t line 30.
# Looks like you planned 10 tests but ran 8.
# Looks like your test exited with 115 just after 8.
t/009_no_route.t .................... Dubious, test returned 115 (wstat 29440, 0x7300)
Failed 2/10 subtests
t/010_qos.t ......................... ok
t/011_hearbeat.t .................... 4/6 # Sleeping for 5 seconds
t/011_hearbeat.t .................... 5/6 # Sleeping for 1 seconds
t/011_hearbeat.t .................... 6/6
#   Failed test 'publish'
#   at t/011_hearbeat.t line 29.
#          got: '0'
#     expected: '-1'
# Looks like you failed 1 test of 6.
t/011_hearbeat.t .................... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests
t/012_timeout.t ..................... ok
t/013_headers.t ..................... Failed 3/20 subtests
t/014_bind_with_headers.t ........... 4/? # Using queue amq.gen-5Jp8TcACflHaUj2-JxNRpw
t/014_bind_with_headers.t ........... ok
t/015_declare_queue_with_headers.t .. 5/?
#   Failed test 'Redeclaring queue without header arguments fails.'
#   at t/015_declare_queue_with_headers.t line 24.
#                   ''
#     doesn't match '(?^:PRECONDITION_FAILED)'
# Looks like you failed 1 test of 6.
t/015_declare_queue_with_headers.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/6 subtests
t/016_reject.t ...................... ok

Test Summary Report
-------------------
t/003_consume.t                   (Wstat: 1024 Tests: 5 Failed: 0)
  Non-zero exit status: 4
  Parse errors: Bad plan.  You planned 7 tests but ran 5.
t/007_get.t                       (Wstat: 512 Tests: 13 Failed: 2)
  Failed tests:  12-13
  Non-zero exit status: 2
t/009_no_route.t                  (Wstat: 29440 Tests: 8 Failed: 0)
  Non-zero exit status: 115
  Parse errors: Bad plan.  You planned 10 tests but ran 8.
t/011_hearbeat.t                  (Wstat: 256 Tests: 6 Failed: 1)
  Failed test:  6
  Non-zero exit status: 1
t/013_headers.t                   (Wstat: 11 Tests: 17 Failed: 0)
  Non-zero wait status: 11
  Parse errors: Bad plan.  You planned 20 tests but ran 17.
t/015_declare_queue_with_headers.t (Wstat: 256 Tests: 6 Failed: 1)
  Failed test:  6
  Non-zero exit status: 1
Files=16, Tests=156, 64 wallclock secs ( 0.04 usr  0.10 sys +  0.17 cusr  0.87 csys =  1.18 CPU)
Result: FAIL
Failed 6/16 test programs. 4/156 subtests failed.
make: *** [test_dynamic] Error 255

===== perl -V =====

Summary of my perl5 (revision 5 version 16 subversion 3) configuration:

  Platform:
    osname=linux, osvers=2.6.32-45-server, archname=x86_64-linux-thread-multi
    uname='linux givengaindev 2.6.32-45-server #103-ubuntu smp thu feb 7 22:33:52 utc 2013 x86_64 gnulinux '
    config_args='-Dusethreads -Dprefix=/opt/tools -d -A ccflags=-fPIC'
    hint=previous, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC',
    optimize='-O2',
    cppflags='-D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_REENTRANT -D_GNU_SOURCE -fPIC -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fPIC'
    ccversion='', gccversion='4.4.3', 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/../lib /usr/lib/../lib /lib /usr/lib /lib64 /usr/lib64
    libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc
    libc=/lib/libc-2.11.1.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.11.1'
  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: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT
                        PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL
                        USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES
                        USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE
                        USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Built under linux
  Compiled at Aug  6 2013 13:55:56
  @INC:
    /opt/tools/lib/perl5/site_perl/5.16.3/x86_64-linux-thread-multi
    /opt/tools/lib/perl5/site_perl/5.16.3
    /opt/tools/lib/perl5/5.16.3/x86_64-linux-thread-multi
    /opt/tools/lib/perl5/5.16.3

Simple receiver fails with "recv() failed: Bad frame read."

I'm starting a new project using RabbitMQ, and I've used Net::RabbitMQ in the past, but now with the latest versions I'm running into a show-stopper.

Even with a simple receiver, I get a "recv() failed: Bad frame read." (similar to issues #12 and #20 ), except I'm not setting a heatbeat at all. It happens after waiting for a message for 30 seconds.

After playing with setting heartbeats, it seems to always fail at 3 times the heartbeat - i.e. if I set it to 5 seconds, it fails at 15 seconds, or if I set it to 60 seconds it fails at 180. If not set (or set to 0), it fails at 30. Setting it negative results in a error on connection.

This is with 0.2.6 with rabbitmq-c 0.3.0, against server 3.0.4. I tried older versions (0.2.2/0.0.1) which I've used successfully in the past, and they do the same thing :(

Seriously simple code below:

!/usr/bin/perl

use Net::RabbitMQ;

use Data::Dumper;

$mqserver = 'localhost';
$mquser = 'guest';
$mqpass = 'guest';
$mqvhost = '/';
$mqport = 5672;
$mqtimeout = 30;

$queue = 'testexec';
$exchange = 'test';

print "Setting up connection\n";
my $mq = Net::RabbitMQ->new();
$mq->connect($mqserver, {
user => $mquser,
password => $mqpass,
port => $mqport,
vhost => $mqvhost,
timeout => $mqtimeout,
#heartbeat => 1,
});

print "Opening channel\n";
$mq->channel_open(1);

eval {
$mq->exchange_declare(1, $exchange, {
exchange_type => 'direct',
auto_delete => 0,
durable => 1,
});
};
if ($@) {
print "exchange_declare() failed: $@\n";
exit 3;
}

eval {
$mq->consume(1,$queue,{ no_ack => 0 });
};
if ($@) {
print "consume() failed: $@\n";
exit 3;
}
eval {
$msg = $mq->recv();
};
if ($@) {
print "recv() failed: $@\n";
exit 3;
}

print Dumper $msg;

Process exit when lost connection

Hello. there is a bug.

example code:

my $queue = Net::RabbitMQ->new();
$queue->connect( .... );
$queue->channel_open(1);

while (1) {
    my $result = $queue->publish( 1, ... );
    print $result . "\n";
    sleep 1;
}

now, if you shutdown RabbitMQ server, when process inside while - perl process will end right after publish.

try or eval will not help.

That's happened because of write call on closed handle

EPIPE
fd is connected to a pipe or socket whose reading end is closed. When this happens the writing process will also receive a SIGPIPE signal. (Thus, the write return value is seen only if the program catches, blocks or ignores this signal.)
http://linux.die.net/man/2/write

And because we unable to handle SIGPIPE - our program is closed.

Tag release versions in GitHub repository

You're missing at least v0.2.3 in the repository. It would really help if you tagged all versions, even the old ones, to help people troubleshoot versions on CPAN.

Compile & test fixes for Solaris 9/perl 5.8.7 (SPARC)

I will be the first to admit that I am doing something strange and unusual, for which I will make no apology. However, I did have to do a couple things to get Net::RabbitMQ 0.2.6 working on Solaris 9 with perl 5.8.7 (SPARC).

The most dubious change (and outside the realm of Net::RabbitMQ's responsibility) is faking <stdint.h> on the system by symlinking it.

That is to say:
# ln -s /usr/include/sys/inttypes.h /usr/include/stdint.h

The second thing to do was fix-up the test headers.

--- 013_headers.t       Fri Jul 13 15:35:59 2012
+++ 013_headers.t.works Tue Oct 23 15:30:29 2012
@@ -37,18 +37,18 @@
 is($@, '', "drain queue");

 my $headers = {
-       abc => 123,
+       abc => '123',
        def => 'xyx',
-       head3 => 3,
-       head4 => 4,
-       head5 => 5,
-       head6 => 6,
-       head7 => 7,
-       head8 => 8,
-       head9 => 9,
-       head10 => 10,
-       head11 => 11,
-       head12 => 12,
+       head3 => '3',
+       head4 => '4',
+       head5 => '5',
+       head6 => '6',
+       head7 => '7',
+       head8 => '8',
+       head9 => '9',
+       head10 => '10',
+       head11 => '11',
+       head12 => '12',
 };
 eval { $mq->publish( 1, "nr_test_route", "Header Test",
                { exchange => "nr_test_x" },

For some reason passing integers to the header makes them come back out as 0 in the test. Since strings work (see the "def" key) that should be sufficient for my needs, although at the time of this writing I have not written my application so this requirement may change.

Here is the failing (unpatched) test output which is corrected by the above patch.

# PERL_DL_NONLAZY=1 /usr/local/bin/perl -W "-MExtUtils::Command::MM" "-e" "test_
harness(0, 'blib/lib', 'blib/arch')" t/013_headers.t
Use of uninitialized value in scalar assignment at /usr/local/lib/perl5/5.8.7/TAP/Parser/Iterator/Process.pm line
84.
Subroutine IPC::Open3::xclose redefined at /usr/local/lib/perl5/5.8.7/TAP/Parser/Iterator/Process.pm line 147.
t/013_headers.t .. 3/20
#   Failed test 'Received headers'
#   at t/013_headers.t line 71.
#     Structures begin differing at:
#          $got->{head12} = '0'
#     $expected->{head12} = '12'
# {
#   'body' => 'Header Test',
#   'consumer_tag' => 'ctag',
#   'delivery_tag' => '',
#   'exchange' => 'nr_test_x',
#   'props' => {
#     'headers' => {
#       'abc' => 0,
#       'def' => 'xyx',
#       'head10' => 0,
#       'head11' => 0,
#       'head12' => 0,
#       'head3' => 0,
#       'head4' => 0,
#       'head5' => 0,
#       'head6' => 0,
#       'head7' => 0,
#       'head8' => 0,
#       'head9' => 0
#     }
#   },
#   'routing_key' => 'nr_test_route'
# }
# Looks like you failed 1 test of 20.
t/013_headers.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/20 subtests
        (less 3 skipped subtests: 16 okay)

Test Summary Report
-------------------
t/013_headers.t (Wstat: 256 Tests: 20 Failed: 1)
  Failed test:  14
  Non-zero exit status: 1
Files=1, Tests=20,  1 wallclock secs ( 0.11 usr  0.03 sys +  0.17 cusr  0.06 csys =  0.37 CPU)
Result: FAIL
Failed 1/1 test programs. 1/20 subtests failed.

memory leak

i have a simple test program,

while (1) {
my $rv = $mq->recv();
my $packed = $rv->{body};

undef $packed;
undef $rv;

}

The memory usage rises time by time, and finally, OOM Killer.

64G RAM, centos linux 5.8

memory leak in fedora 18 with rabbitmq-c from git bleeding

3.6.10-4.fc18.i686 #1 SMP Tue Dec 11 18:24:49 UTC 2012 i686 i686 i386 GNU/Linux

gcc:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i686-redhat-linux/4.7.2/lto-wrapper
Target: i686-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --disable-build-with-cxx --disable-build-poststage1-with-cxx --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch=i686 --build=i686-redhat-linux
Thread model: posix
gcc version 4.7.2 20121109 (Red Hat 4.7.2-8) (GCC)

t/013_headers.t ..................... 1/20 *** glibc detected *** /usr/bin/perl: free(): invalid pointer: 0x088c4748 ***
======= Backtrace: =========
/lib/libc.so.6[0x4aacbff9]
/usr/lib/perl5/CORE/libperl.so(Perl_safesysfree+0x20)[0x4af3bc70]
/usr/lib/perl5/CORE/libperl.so(Perl_hv_undef_flags+0xf8)[0x4af59a78]
/usr/lib/perl5/CORE/libperl.so(Perl_sv_clear+0x1aa)[0x4af6f26a]
/usr/lib/perl5/CORE/libperl.so(Perl_sv_free2+0x5b)[0x4af6fc1b]
/usr/lib/perl5/CORE/libperl.so[0x4af708b8]
/usr/lib/perl5/CORE/libperl.so[0x4af66c4f]
/usr/lib/perl5/CORE/libperl.so(Perl_sv_clean_objs+0x3f)[0x4af704af]
/usr/lib/perl5/CORE/libperl.so(perl_destruct+0x156b)[0x4aeeacdb]
/usr/bin/perl[0x80489f3]
/lib/libc.so.6(__libc_start_main+0xf5)[0x4aa6f865]
/usr/bin/perl[0x8048a95]
======= Memory map: ========
08048000-08049000 r-xp 00000000 fd:01 9586 /usr/bin/perl
08049000-0804a000 r--p 00000000 fd:01 9586 /usr/bin/perl
0804a000-0804b000 rw-p 00001000 fd:01 9586 /usr/bin/perl
087aa000-08944000 rw-p 00000000 00:00 0 [heap]
4aa33000-4aa52000 r-xp 00000000 fd:01 28995 /usr/lib/ld-2.16.so
4aa52000-4aa53000 r--p 0001e000 fd:01 28995 /usr/lib/ld-2.16.so
4aa53000-4aa54000 rw-p 0001f000 fd:01 28995 /usr/lib/ld-2.16.so
4aa56000-4ac06000 r-xp 00000000 fd:01 28996 /usr/lib/libc-2.16.so
4ac06000-4ac08000 r--p 001b0000 fd:01 28996 /usr/lib/libc-2.16.so
4ac08000-4ac09000 rw-p 001b2000 fd:01 28996 /usr/lib/libc-2.16.so
4ac09000-4ac0c000 rw-p 00000000 00:00 0
4ac0e000-4ac11000 r-xp 00000000 fd:01 29007 /usr/lib/libdl-2.16.so
4ac11000-4ac12000 r--p 00002000 fd:01 29007 /usr/lib/libdl-2.16.so
4ac12000-4ac13000 rw-p 00003000 fd:01 29007 /usr/lib/libdl-2.16.so
4ac15000-4ac2b000 r-xp 00000000 fd:01 28997 /usr/lib/libpthread-2.16.so
4ac2b000-4ac2c000 r--p 00015000 fd:01 28997 /usr/lib/libpthread-2.16.so
4ac2c000-4ac2d000 rw-p 00016000 fd:01 28997 /usr/lib/libpthread-2.16.so
4ac2d000-4ac2f000 rw-p 00000000 00:00 0
4ace1000-4ad1f000 r-xp 00000000 fd:01 9426 /usr/lib/libm-2.16.so
4ad1f000-4ad20000 r--p 0003d000 fd:01 9426 /usr/lib/libm-2.16.so
4ad20000-4ad21000 rw-p 0003e000 fd:01 9426 /usr/lib/libm-2.16.so
4ad23000-4ad3a000 r-xp 00000000 fd:01 9135 /usr/lib/libnsl-2.16.so
4ad3a000-4ad3b000 r--p 00016000 fd:01 9135 /usr/lib/libnsl-2.16.so
4ad3b000-4ad3c000 rw-p 00017000 fd:01 9135 /usr/lib/libnsl-2.16.so
4ad3c000-4ad3e000 rw-p 00000000 00:00 0
4ad43000-4ad58000 r-xp 00000000 fd:01 29012 /usr/lib/libresolv-2.16.so
4ad58000-4ad59000 r--p 00014000 fd:01 29012 /usr/lib/libresolv-2.16.so
4ad59000-4ad5a000 rw-p 00015000 fd:01 29012 /usr/lib/libresolv-2.16.so
4ad5a000-4ad5c000 rw-p 00000000 00:00 0
4ad6c000-4ad6e000 r-xp 00000000 fd:01 13369 /usr/lib/libutil-2.16.so
4ad6e000-4ad6f000 r--p 00001000 fd:01 13369 /usr/lib/libutil-2.16.so
4ad6f000-4ad70000 rw-p 00002000 fd:01 13369 /usr/lib/libutil-2.16.so
4aead000-4b031000 r-xp 00000000 fd:01 17000 /usr/lib/perl5/CORE/libperl.so
4b031000-4b032000 ---p 00184000 fd:01 17000 /usr/lib/perl5/CORE/libperl.so
4b032000-4b034000 r--p 00184000 fd:01 17000 /usr/lib/perl5/CORE/libperl.so
4b034000-4b038000 rw-p 00186000 fd:01 17000 /usr/lib/perl5/CORE/libperl.so
4b0b8000-4b107000 r-xp 00000000 fd:01 22800 /usr/lib/libfreebl3.so
4b107000-4b108000 r--p 0004e000 fd:01 22800 /usr/lib/libfreebl3.so
4b108000-4b109000 rw-p 0004f000 fd:01 22800 /usr/lib/libfreebl3.so
4b109000-4b10d000 rw-p 00000000 00:00 0
4b10f000-4b117000 r-xp 00000000 fd:01 29019 /usr/lib/libcrypt-2.16.so
4b117000-4b118000 r--p 00007000 fd:01 29019 /usr/lib/libcrypt-2.16.so
4b118000-4b119000 rw-p 00008000 fd:01 29019 /usr/lib/libcrypt-2.16.so
4b119000-4b140000 rw-p 00000000 00:00 0
b7426000-b742c000 r-xp 00000000 fd:01 141686 /usr/lib/perl5/vendor_perl/auto/Variable/Magic/Magic.so
b742c000-b742d000 r--p 00005000 fd:01 141686 /usr/lib/perl5/vendor_perl/auto/Variable/Magic/Magic.so
b742d000-b742e000 rw-p 00006000 fd:01 141686 /usr/lib/perl5/vendor_perl/auto/Variable/Magic/Magic.so
b742e000-b7432000 r-xp 00000000 fd:01 133200 /usr/lib/perl5/auto/mro/mro.so
b7432000-b7433000 r--p 00003000 fd:01 133200 /usr/lib/perl5/auto/mro/mro.so
b7433000-b7434000 rw-p 00004000 fd:01 133200 /usr/lib/perl5/auto/mro/mro.so
b74b2000-b74ce000 r-xp 00000000 fd:01 17173 /usr/lib/libgcc_s-4.7.2-20121109.so.1
b74ce000-b74cf000 r--p 0001b000 fd:01 17173 /usr/lib/libgcc_s-4.7.2-20121109.so.1
b74cf000-b74d0000 rw-p 0001c000 fd:01 17173 /usr/lib/libgcc_s-4.7.2-20121109.so.1
b74d9000-b74f2000 r-xp 00000000 fd:02 264681 /pool/hume/Net--RabbitMQ/blib/arch/auto/Net/RabbitMQ/RabbitMQ.so
b74f2000-b74f3000 r--p 00018000 fd:02 264681 /pool/hume/Net--RabbitMQ/blib/arch/auto/Net/RabbitMQ/RabbitMQ.so
b74f3000-b74f4000 rw-p 00019000 fd:02 264681 /pool/hume/Net--RabbitMQ/blib/arch/auto/Net/RabbitMQ/RabbitMQ.so
b74f4000-b76f4000 r--p 00000000 fd:01 20539 /usr/lib/locale/locale-archive
b76f4000-b76f7000 rw-p 00000000 00:00 0
b76f8000-b76f9000 rw-p 00000000 00:00 0
b76f9000-b76fe000 r-xp 00000000 fd:01 7930 /usr/lib/perl5/auto/List/Util/Util.so
b76fe000-b76ff000 r--p 00004000 fd:01 7930 /usr/lib/perl5/auto/List/Util/Util.so
b76ff000-b7700000 rw-p 00005000 fd:01 7930 /usr/lib/perl5/auto/List/Util/Util.so
b7700000-b7701000 rw-p 00000000 00:00 0
b7701000-b7702000 r-xp 00000000 00:00 0 [vdso]
bfbbc000-bfbdd000 rw-p 00000000 00:00 0 [stack]
t/013_headers.t ..................... All 20 subtests passed

Test failed (011_hearbeat.t)

I'm getting test failed:

env MQHOST="localhost" make test

PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/001_declare_exchange.t ... ok
t/002_publish.t ............ ok
t/003_consume.t ............ ok
t/004_selfconsume.t ........ ok
t/005_noack.t .............. ok
t/006_txn.t ................ ok
t/007_get.t ................ ok
t/008_queue_declare.t ...... ok
t/009_no_route.t ........... ok
t/010_qos.t ................ ok
t/011_hearbeat.t ........... 1/7 # Sleeping for 5 seconds
t/011_hearbeat.t ........... 5/7

Failed test 'publish'

at t/011_hearbeat.t line 26.

got: '-1'

expected: '0'

Sleeping for 1 seconds

t/011_hearbeat.t ........... 7/7 # Looks like you failed 1 test of 7.
t/011_hearbeat.t ........... Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/7 subtests
t/012_timeout.t ............ ok
t/013_headers.t ............ ok
t/014_bind_with_headers.t .. 1/? # Using queue amq.gen-V0q3V8HJvf/GzaMjpH+ESQ==
t/014_bind_with_headers.t .. ok

Test Summary Report

t/011_hearbeat.t (Wstat: 256 Tests: 7 Failed: 1)
Failed test: 6
Non-zero exit status: 1
Files=14, Tests=142, 11 wallclock secs ( 0.49 usr 0.60 sys + 1.44 cusr 1.16 csys = 3.69 CPU)
Result: FAIL
Failed 1/14 test programs. 1/142 subtests failed.
make: *** [test_dynamic] Error 255

If I just type 'make test', I get the message 'All tests successful' in result.

Client stops consuming

Hi,

I've run into the issue of consuming messages from a queue.

I wrote a daemon which forks several child processes. Each child process is a Net::RabbitMQ client which connects to RabbitMQ server, binds to a queue with its own routing key and starts to consume messages.
So, all the clients (processes) are bound to the same queue with different routing keys.
When the message is received, the client processes it and publish another message to another exchange.

Each process has its life cycle:
while (1) {
my $frame = $mq->recv();

processing frame...

#.......

publish the confirmation

$mq->publish($channel, $another_routing_key, $some_data, {exchange => $another_exchange});
};

After a while one of the clients (not all of them) stops consuming messages until I restart the daemon.
The problem appeared in version 0.1.9 which I installed from CPAN.
After upgrading to 0.2.x this happens more often (every day).
I had to downgrade Net::RabbitMQ to 0.1.9 because it's more stable. The issue happens once a week :)

I see no errors in the log file.

Any ideas?

Thanks.

Protocol failures

Hello, using RabbitMQ server 2.7.1 I am getting failures when enabling heartbeat. If I set to, say, 30 seconds, my consumer daemon dies with the following message:

Bad frame read. at /opt/ed-test/bin/../../common/lib/ED/App/Daemon/MessageConsumer.pm line 98.

I tried to capture the traffic using Wireshark, and it appears that the failure happens when the server sends the third heartbeat while connection is inactive.

I forked Net::RabbitMQ from GitHub to contribute a patch, but then I found more problems. It appears that when using Net::RabbitMQ, the server sends a malformed Channel.Open-Ok response. The RabbitMQ Tracer dies on it:

1326806094072: <Tracer-0> ch#0 <- {#method<connection.start>(version-major=8, version-minor=0, server-properties={product=RabbitMQ, information=Licensed under the MPL.  See http://www.rabbitmq.com/, platform=Erlang/OTP, capabilities={}, copyright=Copyright (C) 2007-2011 VMware, Inc., version=2.7.1}, mechanisms=PLAIN AMQPLAIN, locales=en_US), null, "[B@67006d75"}
1326806094074: <Tracer-0> ch#0 -> {#method<connection.start-ok>(client-properties={}, mechanism=PLAIN, response=guestguest, locale=en_US), null, "[B@67006d75"}
1326806094074: <Tracer-0> ch#0 <- {#method<connection.tune>(channel-max=0, frame-max=131072, heartbeat=0), null, "[B@67006d75"}
1326806094108: <Tracer-0> ch#0 -> {#method<connection.tune-ok>(channel-max=0, frame-max=131072, heartbeat=30), null, "[B@67006d75"}
1326806094109: <Tracer-0> ch#0 -> {#method<connection.open>(virtual-host=/, capabilities=, insist=true), null, "[B@67006d75"}
1326806094149: <Tracer-0> ch#0 <- {#method<connection.open-ok>(known-hosts=), null, "[B@67006d75"}
1326806094188: <Tracer-0> ch#1 -> {#method<channel.open>(out-of-band=), null, "[B@67006d75"}
1326806094231: <Tracer-0> uncaught java.io.EOFException
    at java.io.DataInputStream.readInt(DataInputStream.java:392)
    at com.rabbitmq.client.impl.ValueReader.readBytes(ValueReader.java:86)
    at com.rabbitmq.client.impl.ValueReader.readLongstr(ValueReader.java:103)
    at com.rabbitmq.client.impl.ValueReader.readLongstr(ValueReader.java:111)
    at com.rabbitmq.client.impl.MethodArgumentReader.readLongstr(MethodArgumentReader.java:73)
    at com.rabbitmq.client.impl.AMQImpl$Channel$OpenOk.<init>(AMQImpl.java:600)
    at com.rabbitmq.client.impl.AMQImpl.readMethodFrom(AMQImpl.java:3242)
    at com.rabbitmq.client.impl.CommandAssembler.consumeMethodFrame(CommandAssembler.java:93)
    at com.rabbitmq.client.impl.CommandAssembler.handleFrame(CommandAssembler.java:158)
    at com.rabbitmq.client.impl.AMQCommand.handleFrame(AMQCommand.java:87)
    at com.rabbitmq.tools.Tracer$DirectionHandler.doFrame(Tracer.java:331)
    at com.rabbitmq.tools.Tracer$DirectionHandler.run(Tracer.java:343)
    at java.lang.Thread.run(Thread.java:636)

and Wireshark/tshark shows a Malformed Packet error:

  0.000980    127.0.0.1 -> 127.0.0.1    AMQP Protocol-Header 
  0.001148    127.0.0.1 -> 127.0.0.1    AMQP Connection.Start 
  0.001303    127.0.0.1 -> 127.0.0.1    AMQP Connection.Start-Ok 
  0.001405    127.0.0.1 -> 127.0.0.1    AMQP Connection.Tune 
  0.001511    127.0.0.1 -> 127.0.0.1    AMQP Connection.Tune-Ok 
  0.031825    127.0.0.1 -> 127.0.0.1    AMQP Connection.Open 
  0.031946    127.0.0.1 -> 127.0.0.1    AMQP Connection.Open-Ok 
  0.032313    127.0.0.1 -> 127.0.0.1    AMQP Channel.Open 
  0.032770    127.0.0.1 -> 127.0.0.1    AMQP [Malformed Packet]
  0.032822    127.0.0.1 -> 127.0.0.1    AMQP Tx.Select 
  0.032886    127.0.0.1 -> 127.0.0.1    AMQP Tx.Select-Ok 

This does not happen when using other client libraries (such the Java client library), so I suspect there's something wrong in what the Net::RabbitMQ library sends, that causes the server to send a malformed answer.

I tried to check Net::RabbitMQ source code, but I was unable to find what's wrong. To recap, two issues:

  • Channel.Open-Ok from server is malformed (but it isn't with other client libraries)
  • enabling heartbeats causes the app to die with "Bad frame read"

I'm now reverting to my own Net::RabbitMQ::Java, but I'd love to use Net::RabbitMQ instead, so let me know your thoughts and how can I help about this issue.

Tests in 012_timeout.t fail

Hiya

When running make test initiially I was getting this:

#   Failed test 'connect'
#   at t/012_timeout.t line 16.
#          got: ''
#     expected: anything else

then I shut down the rabbitmq server, and that test passed.

However, I'm still getting this failure:

t/012_timeout.t .. 1/4 
#   Failed test 'timeout'
#   at t/012_timeout.t line 18.
#     '0.599854'
#         <
#     '0.05'
# Looks like you failed 1 test of 4.
t/012_timeout.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/4 subtests 

ta

clint

Segmentation fault in subroutine get

Hi!

I reported a segmentation fault in CPAN:
https://rt.cpan.org/Public/Bug/Display.html?id=76205

I got a segmentation fault in subroutine get. I think it is because memory allocation failed.
I have Net::RabbitMQ version 0.2.2. I got a similar bug in Net::RabbitMQ version 0.2.0, too: https://rt.cpan.org/Public/Bug/Display.html?id=76156
This is perl, v5.10.0 built for x86_64-linux-thread-multi
Linux pmc-inst-test 2.6.32.12-0.7-default #1 SMP 2010-05-20 11:14:20 +0200 x86_64 x86_64 x86_64 GNU/Linux

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff724fa41 in memcpy () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff724fa41 in memcpy () from /lib64/libc.so.6
#1 0x00007ffff6db2c0d in amqp_handle_input (state=0x7bc8a0,

received_data=..., decoded_frame=0x7fffffffe2c0)
at /usr/include/bits/string3.h:52

#2 0x00007ffff6dbbeec in wait_frame_inner (state=0x7bc8a0,

decoded_frame=0x7fffffffe2c0) at amqp_socket.c:167

#3 0x00007ffff6dbc489 in amqp_simple_rpc (state=0x7bc8a0, channel=3,

request_id=<value optimized out>, expected_reply_ids=0x7fffffffe3a0, 
decoded_request_method=<value optimized out>) at amqp_socket.c:283

#4 0x00007ffff6db156c in amqp_basic_get (state=0x7bc8a0, channel=7,

queue=..., no_ack=1) at amqp_api.c:258

#5 0x00007ffff6da7432 in XS_Net__RabbitMQ_get (my_perl=,

cv=<value optimized out>) at RabbitMQ.xs:618

#6 0x000000000047e115 in Perl_pp_entersub ()
#7 0x0000000000455ad3 in Perl_runops_debug ()
#8 0x000000000047a005 in perl_run ()
#9 0x000000000042172c in main ()

(gdb)

regards, Matti Linnanvuori

failed test

linux: centos5.8
perl: 5.16.2, 5.12.5, 5.8.8

t/015_declare_queue_with_headers.t .. 1/?
Failed test 'Redeclaring queue without header arguments fails.'
at t/015_declare_queue_with_headers.t line 24.
''
doesn't match '(?^:PRECONDITION_FAILED)'
Looks like you failed 1 test of 6.

t/009_no_route.t .................... 1/10 Closing connection: server connection error 540, message: NOT_IMPLEMENTED - immediate=true at t/009_no_route.t line 30.
Looks like you planned 10 tests but ran 8.
Looks like your test exited with 115 just after 8.
t/009_no_route.t .................... Dubious, test returned 115 (wstat 29440, 0x7300)
Failed 2/10 subtests

t/003_consume.t ..................... 1/7 Died at t/003_consume.t line 20.
Looks like you planned 7 tests but ran 5.
Looks like your test exited with 4 just after 5.
t/003_consume.t ..................... Dubious, test returned 4 (wstat 1024, 0x400)
Failed 2/7 subtests

SIGPIPE / Bad frame read

It seems like there's some sort of heartbeat/timeout bug that I'm encountering. I have a little script waiting for messages using recv. My initial first pass was to undef my broker and reconnect, but doing so causes DESTROY to crash with SIGPIPE. Below is some GDB output.

Bad frame read. 

Program received signal SIGPIPE, Broken pipe.
0x0000003b1260d8c0 in __write_nocancel () from /lib64/libpthread.so.0
(gdb) bt
#0  0x0000003b1260d8c0 in __write_nocancel () from /lib64/libpthread.so.0
#1  0x00002aaaafb50aac in amqp_send_frame (state=0x18cf670, frame=<value optimized out>) at amqp_connection.c:384
#2  0x00002aaaafb5a04e in amqp_send_method (state=0x8, channel=<value optimized out>, id=22, 
    decoded=0xffffffffffffffff) at amqp_socket.c:249
#3  0x00002aaaafb5a0b2 in amqp_simple_rpc (state=0x18cf670, channel=800, request_id=4294967264, 
    expected_reply_ids=0x7fffffffda30, decoded_request_method=0x7fffffffdb40) at amqp_socket.c:272
#4  0x00002aaaafb503aa in amqp_connection_close (state=0x18cf670, code=200) at amqp_api.c:116
#5  0x00002aaaafb469dd in XS_Net__RabbitMQ_DESTROY (my_perl=<value optimized out>, cv=<value optimized out>)
    at RabbitMQ.xs:705
#6  0x0000003935490aa6 in Perl_pp_entersub () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#7  0x00000039354338a7 in ?? () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#8  0x00000039354376f0 in Perl_call_sv () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#9  0x0000003935495426 in Perl_sv_clear () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#10 0x0000003935495bd0 in Perl_sv_free () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#11 0x0000003935495737 in Perl_sv_clear () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#12 0x0000003935495bd0 in Perl_sv_free () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#13 0x0000003935484cbc in Perl_hv_free_ent () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#14 0x0000003935484e26 in ?? () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#15 0x0000003935486750 in Perl_hv_undef () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#16 0x000000393549582a in Perl_sv_clear () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#17 0x0000003935495bd0 in Perl_sv_free () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#18 0x00000039354b82cc in Perl_free_tmps () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#19 0x000000393548b7da in Perl_pp_nextstate () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#20 0x000000393548a34e in Perl_runops_standard ()
   from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#21 0x0000003935437e9c in perl_run () from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so
#22 0x00000000004017bc in main ()
(gdb) 

queue_delete

Method queue_delete not implemented in XS. I can pull patch if need.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.