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

Exit when invalid engine is selected #4586

Merged
merged 1 commit into from
Oct 28, 2015
Merged

Exit when invalid engine is selected #4586

merged 1 commit into from
Oct 28, 2015

Conversation

otoolep
Copy link
Contributor

@otoolep otoolep commented Oct 27, 2015

Fix #4585, related to #4583

@otoolep
Copy link
Contributor Author

otoolep commented Oct 27, 2015

It is not possible to exit short of a panic, but this change makes it very clear in the logs.

[write] 2015/10/27 11:56:14 write failed for shard 1 on node 1: new engine: engine xxx does not exist
[monitor] 2015/10/27 11:56:14 failed to store statistics: write failed: new engine: engine xxx does not exist
[write] 2015/10/27 11:56:24 write failed for shard 1 on node 1: new engine: engine xxx does not exist
[monitor] 2015/10/27 11:56:24 failed to store statistics: write failed: new engine: engine xxx does not exist

@otoolep
Copy link
Contributor Author

otoolep commented Oct 27, 2015

@jwilder @beckettsean

@beckettsean
Copy link
Contributor

works for me

@jwilder
Copy link
Contributor

jwilder commented Oct 27, 2015

Could we validate this in the config? i.e.: https://github.com/influxdb/influxdb/blob/master/cmd/influxd/run/command.go#L104

@otoolep
Copy link
Contributor Author

otoolep commented Oct 27, 2015

Yeah, that might be better. Let me try that.

On Tue, Oct 27, 2015 at 12:19 PM, Jason Wilder notifications@github.com
wrote:

Could we validate this in the config? i.e.:
https://github.com/influxdb/influxdb/blob/master/cmd/influxd/run/command.go#L104


Reply to this email directly or view it on GitHub
#4586 (comment).

@otoolep
Copy link
Contributor Author

otoolep commented Oct 28, 2015

OK, updated as per @jwilder . Program now exits, which is better.

$ ./influxd -config ~/Dropbox/influxdb/config.graphite.toml 

 8888888           .d888 888                   8888888b.  888888b.
   888            d88P"  888                   888  "Y88b 888  "88b
   888            888    888                   888    888 888  .88P
   888   88888b.  888888 888 888  888 888  888 888    888 8888888K.
   888   888 "88b 888    888 888  888  Y8bd8P' 888    888 888  "Y88b
   888   888  888 888    888 888  888   X88K   888    888 888    888
   888   888  888 888    888 Y88b 888 .d8""8b. 888  .d88P 888   d88P
 8888888 888  888 888    888  "Y88888 888  888 8888888P"  8888888P"

2015/10/27 17:10:46 InfluxDB starting, version 0.9, branch unknown, commit unknown, built unknown
2015/10/27 17:10:46 Go version go1.5.1, GOMAXPROCS set to 8
2015/10/27 17:10:46 Using configuration at: /home/philip/Dropbox/influxdb/config.graphite.toml
run: unrecognized engine xxx. To generate a valid configuration file run `influxd config > influxdb.generated.conf`.

@@ -128,3 +130,24 @@ func NewConfig() Config {
QueryLogEnabled: true,
}
}

func (c *Config) Validate() error {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This pattern, of adding Validate to individual config types, exists elsewhere in the code.

@otoolep otoolep changed the title Log error when invalid engine is selected Exit when invalid engine is selected Oct 28, 2015
@jwilder
Copy link
Contributor

jwilder commented Oct 28, 2015

👍

otoolep added a commit that referenced this pull request Oct 28, 2015
Exit when invalid engine is selected
@otoolep otoolep merged commit d8e4655 into master Oct 28, 2015
@otoolep otoolep deleted the engine_fail_msg branch October 28, 2015 04:50
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.

None yet

3 participants