-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the bug
This behavior might be intended. However, if you write your own entrypoint into the collector, as I have, and you call otelcol.Collector.DryRun()
with a goal of determining whether the configuration "looks valid" before calling Run()
, then service.New()
is now called as part of the dry run, and its return value is discarded. This behavior is a consequence of this commit.
Due to the above behavior, calling DryRun()
now, for example, calls open()
and bind()
for the self-monitoring telemetry-service port and the health-check extension port, among other ports. When Run()
is subsequently called, the second instance of each server component fails with a bind()
error because its port has already been opened and bound.
This might be a misuse of the DryRun()
function. Let me know, and thanks in advance.
Steps to reproduce
Write the above code.
What did you expect to see?
The old behavior.
What did you see instead?
Error: failed to start extensions: failed to bind to address 0.0.0.0:13133: listen tcp 0.0.0.0:13133: bind: address already in use; failed to shutdown pipelines: no existing monitoring routine is running
2024/04/24 22:03:22 collector server run finished with error: failed to start extensions: failed to bind to address 0.0.0.0:13133: listen tcp 0.0.0.0:13133: bind: address already in use; failed to shutdown pipelines: no existing monitoring routine is running
What version did you use?
v0.98.0
Environment
go version go1.22.0 linux/amd64