Skip to content
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

Merged
merged 2 commits into from
Jul 22, 2015

Conversation

nathanielc
Copy link
Contributor

Catch bad OpenTSDB tags before they make it to the handoff process.

#3417

@otoolep
Copy link
Contributor

otoolep commented Jul 21, 2015

Thanks @nathanielc -- just so I am clear, you mean an input such as tag= or =value?

@nathanielc
Copy link
Contributor Author

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.

@otoolep
Copy link
Contributor

otoolep commented Jul 21, 2015

+1 from me.

@corylanou

@@ -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 {
Copy link
Contributor

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.

@corylanou
Copy link
Contributor

One incredibly small nit, but still +1 regardless.

@otoolep
Copy link
Contributor

otoolep commented Jul 22, 2015

@nathanielc -- thanks. Have you signed the CLA?

@nathanielc
Copy link
Contributor Author

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.

@nathanielc
Copy link
Contributor Author

Well I tried signing again but got an error from google drive. I'll try again later.

@nathanielc
Copy link
Contributor Author

Signed.

@otoolep
Copy link
Contributor

otoolep commented Jul 22, 2015

Thanks @nathanielc

otoolep added a commit that referenced this pull request Jul 22, 2015
catch opentsdb malformed tags if they are missing keys or values
@otoolep otoolep merged commit d9ba1cc into influxdata:master Jul 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants