-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
catch opentsdb malformed tags if they are missing keys or values #3420
Conversation
Thanks @nathanielc -- just so I am clear, you mean an input such as |
Correct. I had a bad system send data like 'tag=' and the OpenTSDB service accepted it but then later during replication it would break. Better to fail early. |
+1 from me. |
@@ -216,7 +216,7 @@ func (s *Service) handleTelnetConn(conn net.Conn) { | |||
tags := make(map[string]string) | |||
for t := range tagStrs { | |||
parts := strings.SplitN(tagStrs[t], "=", 2) | |||
if len(parts) != 2 { | |||
if len(parts) != 2 || len(parts[0]) == 0 || len(parts[1]) == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super crazy smal nit: For code clarity, I prefer parts[0] == ""
. The compiler is at some point going to compile len(parts[0]) == 0
the same way it compiles parts[0] == ""
so I prefer code clarity for this.
One incredibly small nit, but still +1 regardless. |
@nathanielc -- thanks. Have you signed the CLA? |
Yes, I signed it as nvcook42 but a few weeks back change my github username to nathanielc. I can sign it again to avoid issues. |
Well I tried signing again but got an error from google drive. I'll try again later. |
Signed. |
Thanks @nathanielc |
catch opentsdb malformed tags if they are missing keys or values
Catch bad OpenTSDB tags before they make it to the handoff process.
#3417