In working with passive mode and selectables, I've hit a strange reproducible problem.
I have a simple add-on to Messenger that lets me have it push incoming messages to an EventMachine channel [1]. If I send messages to the echo example app (it's not echoing yet), it will consistently receive around 24 messages before dying. I've tried putting delays in between the sends. I've sent the messages in batches (tried 100, tried sending in units of 10 and 5). Each time it blows up around the 24th message. The underlying error the comes up is always the same: ---8<[snip]--- *** I received: This is message 22 ??? read_array=[9, 7] write_array=[9, 7] +++ fd=9 : rarray=[] +++ fd=7 : rarray=[#<IO:fd 9>] +++ fd=9 : warray=[] +++ fd=7 : warray=[#<IO:fd 9>] ### capacity=16384 pending=0 ??? read_array=[9, 7, 12] write_array=[9, 7, 12] +++ fd=9 : rarray=[] +++ fd=7 : rarray=[#<IO:fd 9>] +++ fd=12 : rarray=[#<IO:fd 9>, #<IO:fd 7>] +++ fd=9 : warray=[] +++ fd=7 : warray=[#<IO:fd 9>] +++ fd=12 : warray=[#<IO:fd 9>, #<IO:fd 7>] ### capacity=16384 pending=0 ??? read_array=[9, 7, 12] write_array=[9, 7, 12] +++ fd=9 : rarray=[] +++ fd=7 : rarray=[#<IO:fd 9>] +++ fd=12 : rarray=[#<IO:fd 9>, #<IO:fd 7>] +++ fd=9 : warray=[] +++ fd=7 : warray=[#<IO:fd 9>] +++ fd=12 : warray=[#<IO:fd 9>, #<IO:fd 7>] recv: Bad file descriptor [0x7f88b80700c0]:ERROR[-2] AMQP header mismatch: '' (connection aborted) CONNECTION ERROR connection aborted (remote) !!! deleting fd=12 ??? read_array=[9, 7] write_array=[9, 7] +++ fd=9 : rarray=[] /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:80:in `initialize': Bad file descriptor (Errno::EBADF) from /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:80:in `new' from /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:80:in `block (3 levels) in start_event_monitor' from /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:78:in `each' from /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:78:in `block (2 levels) in start_event_monitor' from /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:39:in `loop' from /home/mcpierce/Programming/eventful-qpid-proton/lib/eventful-qpid-proton/event_machine.rb:39:in `block in start_event_monitor' ruby-mri: /home/mcpierce/Programming/Proton/proton-c/src/object/object.c:99: pn_free: Assertion `pn_refcount(object) == 1' failed. Aborted ---8<[snip]--- At the point where the error occurs, Ruby is attempting to wrap the fileno returned by the Selectable in an IO object. In this case it is almost always the number 9 that's coming up. Anybody see anything related to this before? [1] https://github.com/mcpierce/eventful-qpid-proton -- Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc. Delivering value year after year. Red Hat ranks #1 in value among software vendors. http://www.redhat.com/promo/vendor/
pgpBhKnix2SGL.pgp
Description: PGP signature