-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XXX characters being prepended to metrics when sent via UDP #241
Comments
We've done some more investigating and it appears that netcat might be sending X's as a part of the stream, but only when you run Anyway, I'll close this. Its clearly a bug in bsd nc on linux |
Ah. netcat has too many implementations that aren't finished, and too many incarnations by distributions to finish those implementations. I feel your pain. Let me know if you suspect the relay might play a role in this. |
Interestingly enough - it seems that carbon-relay (python version) might ignore or strip these X's, at least we didn't see them come in with them until we switched over to carbon-c-relay. We did find this glorious bit of code that shows netcat will test the UDP port first before sending data. https://github.com/openbsd/src/blob/master/usr.bin/nc/netcat.c#L1385-L1402 We ended up changing and using the traditional nc and NOT the openbsd variant as this was the 2nd UDP related bug we found with it. |
That's really odd behaviour! I'm not sure I understand how carbon-relay could skip/ignore those. Perhaps they are supposed to be delivered as single package each, and hence discarded for being invalid. I wonder in that case why carbon-c-relay sees it as continued messages. Perhaps there's a bug in the handling (and proper termination) of UDP packages. I'll have a look. |
As reported in issue #241, the relay was concatenating UDP packets until it found a newline to terminate a line. Since UDP packets don't necessarily arrive (or in order), one can't rely on sending partial fragments. So instead, make sure we treat each received UDP packet as a full message (and all we're going to get).
Just for the record, I've fixed the X-probings to prepended to the metrics. |
I've been seeing an odd issue when running the v2.3 version of carbon c relay.
If you send a metric to carbon-c-relay via UDP like:
the metric will land on the carbon cache as:
If you send the same metric but as TCP:
Then the metric lands correctly
I've done a packet capture on the carbon-c-relay port as well as the carbon cache port to see that when the metric hits the relay its fine, but when it hits the cache its prepended with XXX's What's interesting is some hosts send only a single X, others will send multiples like:
Running a strace on the process we see the following.
The text was updated successfully, but these errors were encountered: