Skip to content

Handle missing eventstream.retry_interval value better #35

@magnusbaeck

Description

@magnusbaeck

Expected Behavior

If the eventstream.retry_interval configuration option is left out from the configuration I expect the program to either pick a reasonable default or abort with a useful error message.

Current Behavior

panic: non-positive interval for NewTicker

goroutine 47 [running]:
time.NewTicker(0x0, 0xc4200a2b00)
	/usr/local/go/src/time/tick.go:23 +0x1a1
github.com/icinga/icingabeat/beater.(*Eventstream).Run(0xc4204b4180, 0x0, 0x0)
	/go/src/github.com/icinga/icingabeat/beater/eventstream.go:127 +0x873
created by github.com/icinga/icingabeat/beater.(*Icingabeat).Run
	/go/src/github.com/icinga/icingabeat/beater/icingabeat.go:49 +0x32d

Possible Solution

Updating DefaultConfig in config/config.go to set a default value for Eventstream.RetryInterval should be enough. IIRC the Beats library has hooks for validation as well if we really want to force users to specify that option, but I don't think the retry interval is that important that we should force users to make a choice.

Steps to Reproduce (for bugs)

  1. Start with a working Icingabeat configuration.
  2. Comment out the eventstream.retry_interval line in icingabeat.yml.
  3. Panic.

Your Environment

  • Beat version (icingabeat -version): 6.5.4

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions