-
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
Input plugins should retry database creation #7477
Conversation
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.
Looks good except it seems like createInternalStorage
should be returning an error if it fails.
@@ -397,6 +439,9 @@ func (s *Service) processBatches(batcher *tsdb.PointBatcher) { | |||
for { | |||
select { | |||
case batch := <-batcher.Out(): | |||
// Will attempt to create database if not yet created. | |||
s.createInternalStorage() |
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.
Shouldn't this check for an error being returned?
case batch := <-batcher.Out(): | ||
// Will attempt to create database if not yet created. | ||
s.createInternalStorage() |
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.
Check for an error?
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.
Since there is nothing we can do but log the error, it seems cleaner to have createInternalStorage
check for an error and log it itself.
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.
But then it continues on to try the write which will fail as well and tie up resources. Seems like we should abort the write here since we already know it will fail.
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.
Ah sorry I see what you mean. OK I'll refactor that.
3e2b5a0
to
18dfcf3
Compare
18dfcf3
to
168c91c
Compare
Required for all non-trivial PRs
Ensure input services can be safely opened and closed #7463 needs to be merged first.
This PR changes how input plugins open. Instead of trying to create a database on open they will instead check if they have successfully created a database when processing data.
@jwilder