poseidon icon indicating copy to clipboard operation
poseidon copied to clipboard

Sporadic error fetching data from consumer caused by checksum and decoding issue

Open daluu opened this issue 9 years ago • 0 comments

I guess I should also investigate on my end how the Kafka messages in the subscribed topic are encoded, but for now, I get this error every once in a while when fetching messages as consumer. And this is from code based on the sample code.

When it doesn't happen, messages fetch fine, for messages in same topic. It can happen real quick, or after some time, I never ran it long enough (past 1-5 minutes or more) to be able to know if it might never happen at all. I believe the messages I fetch are of all the same format with varying data.

Since it works half the time at least, this seems to be some communications reliability issue than basic functional issue. Could it be timing related?

Is there a way to see what the consumer got when it failed at decoding the message? To help narrow down the problem. Also like if for checksum error, what was the (expected) computed and received checksums.

require 'poseidon'

consumer = Poseidon::PartitionConsumer.new("my_test_consumer", "localhost", 9092,
                                            "topic1", 0, :earliest_offset)

loop do
  messages = consumer.fetch
  messages.each do |m|
    puts m.value # or do whatever to m.value
  end
end

and here's the error message I often get:

/Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:192:in rescue in block in read': Error while reading messages in Poseidon::Protocol::MessageSetStructWithSize (Poseidon::Errors::ChecksumError: Poseidon::Errors::ChecksumError)) (Poseidon::Protocol::ProtocolStruct::DecodingError) from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:186:inblock in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:in each' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:inread' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:155:in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/message_set.rb:12:inread' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:239:in read_type' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:230:inread_member' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:187:in block in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:ineach' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:155:inread' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:239:in read_type' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:inblock in read_member' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:in times' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:ineach' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:in map' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:inread_member' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:187:in block in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:ineach' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:155:inread' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:239:in read_type' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:inblock in read_member' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:in times' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:ineach' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:in map' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:227:inread_member' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:187:in block in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:ineach' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:185:in read' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/protocol/protocol_struct.rb:155:inread' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/connection.rb:120:in read_response' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/connection.rb:76:infetch' from /Users/daluu/.rvm/gems/ruby-2.2.1/gems/poseidon-0.0.5/lib/poseidon/partition_consumer.rb:108:in `fetch'

daluu avatar Jun 15 '15 17:06 daluu