Skip to content

Retry broker connections? #45

@reefland

Description

@reefland

Is there a way to configure connection retries? I had to bounce the broker and the mosquitto-exporter log ended with:

2022/08/15 00:49:37 Error: Connection to tcp://mosquitto-mqtt.mosquitto:1883 lost: EOF

No sign of a retry, the program doesn't exit out to trigger a container restart policy.

I manually restarted mosquitto-exporter and connected fine.

2022/08/15 17:57:14 Starting mosquitto_broker 0.8.0 (e268064), go1.17.2
2022/08/15 17:57:14 Connected to tcp://mosquitto-mqtt.mosquitto:1883
[store]    memorystore wiped
2022/08/15 17:57:14 Listening on 0.0.0.0:9234...

If the exporter can't connect, it should retry a set number of times and then exit out to allow the restart policy to kick in. Then it becomes a condition that can be monitored and fixed.

Metadata

Metadata

Assignees

No one assigned

    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