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

LB-157: Handle bad listens in a smarter way in influx-writer #175

Merged
merged 3 commits into from May 22, 2017

Conversation

paramsingh
Copy link
Collaborator

Recursively divide the data into two parts until we find the listen
that was failing. This means that only the bad listen gets rejected
and not an entire batch.

Recursively divide the data into two parts until we find the listen
that was failing. This means that only the bad listen gets rejected
and not an entire batch.
@paramsingh
Copy link
Collaborator Author

As discussed on IRC, it is hard to find a bad listen that our API accepts but influx rejects, so I haven't added an integration test for this. However this functionality still is important because exceptions have been triggered in the past and can happen in the future also.

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just that one little change for clarity and we can merge.

while True:
try:
self.ls.insert(data)
done = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could skip the whole done flag if you just returned len(data) here -- that would also simplify the code below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Member

@mayhem mayhem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay!

@mayhem mayhem merged commit a42a82f into metabrainz:master May 22, 2017
@paramsingh paramsingh deleted the influx-writer/bad-listens branch May 22, 2017 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants