opentelemetry-collector icon indicating copy to clipboard operation
opentelemetry-collector copied to clipboard

collector state won't be set to Running state after watch is triggered

Open splunkericl opened this issue 3 years ago • 4 comments
trafficstars

Describe the bug After configuration is updated and watch is triggered, the collector health state will be stuck at Starting even tho the collector has started completely.

Steps to reproduce

  • Run the collector
  • trigger watch operation in config provider
  • check collector state by calling GetState
  • state won't be in Running and will always be in Starting

What did you expect to see? collector state to be Running

What did you see instead? Collector state is always Starting

What version did you use? latest. https://github.com/open-telemetry/opentelemetry-collector/blob/main/service/collector.go#L140

What config did you use? any config

Environment OS: mac catalina

splunkericl avatar Aug 05 '22 15:08 splunkericl

The bug is relatively easy to fix, we just need to set the collector state to running after https://github.com/open-telemetry/opentelemetry-collector/blob/main/service/collector.go#L154 or move col.setCollectorState(Running) to the end of setupConfigurationComponents call

splunkericl avatar Aug 05 '22 16:08 splunkericl

Thanks for the report. Please submit a PR with the fix.

bogdandrutu avatar Aug 05 '22 17:08 bogdandrutu

@dmitryax I can take that over.

kovrus avatar Aug 11 '22 12:08 kovrus