首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >一段时间没有消息后,Bunny::NoFinalOctetError

一段时间没有消息后,Bunny::NoFinalOctetError
EN

Stack Overflow用户
提问于 2017-10-18 22:40:55
回答 1查看 93关注 0票数 2

使用与official docker image一起安装的rabbit后,我的worker在一段时间(大约40秒)后失败,并出现异常Bunny::NoFinalOctetError。

我的工人代码是:

代码语言:javascript
复制
require 'bunny'
require 'securerandom'

#TODO set host as parameter
rabbit_conn = Bunny.new
rabbit_conn.start

ch   = rabbit_conn.create_channel
q    = ch.queue("task", :durable => true)
ch.prefetch(1)

begin
  q.subscribe(:manual_ack => true, :block => true) do |delivery_info, properties, body|
        pp body 
    ch.ack(delivery_info.delivery_tag)
  end
rescue Interrupt => _
  rabbit_conn.close
end

我通过以下代码发送数据:

代码语言:javascript
复制
require "bunny"

conn = Bunny.new
conn.start

ch   = conn.create_channel
q    = ch.queue("task", :durable => true)

[
    'titi',
    'toto',
    'tata'
].each do |d|
    q.publish(d, :persistent => true)
end

sleep 1.0
conn.close

在40岁左右,我在我的工人中得到了如下的输出

代码语言:javascript
复制
"titi"
"toto"
"tata"
E, [2017-10-18T15:56:55.938661 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>: Exception in the reader loop: Bunny::NoFinalOctetError: Frame doesn't end with � as it must, which means the size is miscalculated.
E, [2017-10-18T15:56:55.938890 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>: Backtrace: 
E, [2017-10-18T15:56:55.939037 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>:     /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/transport.rb:255:in `read_next_frame'
E, [2017-10-18T15:56:55.939114 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>:     /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/reader_loop.rb:68:in `run_once'
E, [2017-10-18T15:56:55.939175 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>:     /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/reader_loop.rb:35:in `block in run_loop'
E, [2017-10-18T15:56:55.939233 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>:     /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/reader_loop.rb:32:in `loop'
E, [2017-10-18T15:56:55.939288 #28583] ERROR -- #<Bunny::Session:0x56182de41e48 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>:     /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/reader_loop.rb:32:in `run_loop'
Traceback (most recent call last):
        5: from worker2.rb:21:in `<main>'
        4: from /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/queue.rb:196:in `subscribe'
        3: from /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/consumer_work_pool.rb:77:in `join'
        2: from /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/consumer_work_pool.rb:77:in `each'
        1: from /home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/consumer_work_pool.rb:77:in `block in join'
/home/gg/.rvm/gems/ruby-head/gems/bunny-2.7.1/lib/bunny/consumer_work_pool.rb:77:in `join': caught an unexpected exception in the network loop: Frame doesn't end with � as it must, which means the size is miscalculated. (Bunny::NetworkFailure)

关于网络的更新

我嗅探了一下网络,因为它似乎是一个格式错误的网络数据包。实际上,错误是在接收到特定分组之后触发的。

在下面的Whireshark捕获中,错误发生在接收数据包299时。

然而,我不知道这个包是什么,也不知道为什么它不是由bunny处理的。

更新Github票证

我打开了一个票证here

EN

回答 1

Stack Overflow用户

发布于 2017-10-20 17:31:14

事实证明,数据包解析是一个问题。

该错误可以通过her进行跟踪

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46812873

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档