logstash-plugins / logstash-codec-collectd

Apache License 2.0
6 stars 11 forks source link

Wrong assumptions decoding protocol #13

Closed octo closed 9 years ago

octo commented 9 years ago

Hi, this is a follow-up to elastic/logstash#2014 and #6, which I don't believe to be fixed.

The coment in line 424 in collectd.rb reads:

We've reached a new plugin, delete everything except for the the host field, because there's only one per packet and the timestamp field, because that one goes in front of the plugin

Pretty much everything in this comment is wrong:

Creating a set of test vectors for the binary protocol is on my todo list and I'll happily drop a reference here once I have that.

Thanks for all your awesome work!

jordansissel commented 9 years ago

@octo Thanks for helping clarify this! <3 <3 <3

untergeek commented 9 years ago

Question: If true, doesn't this indicate that multithreading is a no-no? We could potentially read packets out of order and therefore overwrite fields out of band...

octo commented 9 years ago

@untergeek what I outlined above only applies to parsing a single packet. State does not carry over to other packets, i.e. each packet starts with a clean slate / empty state.

untergeek commented 9 years ago

I believe these issues are addressed in #16

Care to comment, @octo?

octo commented 9 years ago

@untergeek the Ruby is weak in me, but as far as I can tell the patch looks reasonable. I think we can close this bug for now and trust in actual users opening a new one if a corner case slipped through ;) Thanks for taking care of this!

untergeek commented 9 years ago

Thanks @octo