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

mosquitto_pub -l doesn't handle server failures #1152

Closed
dustin opened this issue Feb 10, 2019 · 3 comments
Closed

mosquitto_pub -l doesn't handle server failures #1152

dustin opened this issue Feb 10, 2019 · 3 comments
Labels
Component: mosquitto-clients Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@dustin
Copy link

dustin commented Feb 10, 2019

I've got a shell script that's spitting out a number periodically into mosquitto_pub -t something -q 2 -l and have found that any server failures (e.g., restarting the server) is seemingly ignored. The program continues to run, but never sends data to the MQTT broker again.

I'd prefer one of:

  1. reconnect
  2. just exit with a failure
@ralight
Copy link
Contributor

ralight commented Feb 10, 2019

Work for me with a quick test. I'll do more tests, but for the moment which version are you using and on what platform?

@dustin
Copy link
Author

dustin commented Feb 10, 2019

mosquitto_pub version 1.5.6 running on libmosquitto 1.5.6.

$ cat /etc/debian_version
buster/sid

$ uname -a
Linux eve 4.19.0-1-amd64 #1 SMP Debian 4.19.12-1 (2018-12-22) x86_64 GNU/Linux

I've got the following script running persistently. I noticed I had not got any data since around the time I restarted to debug something else last night. The script and its constituent parts were still running, but no data showed up in mqtt until I restarted it.

#!/bin/sh -e

sample() {
    while : 
    do
            echo 'select count(*) from spool' | sqlite3 $HOME/influx.spool
            sleep 60
    done
}

sample | mosquitto_pub --will-topic errors --will-payload 'sj spool reporter discod' \
                       -q 2 -t 'sj/influxer/spool' -l

@ralight
Copy link
Contributor

ralight commented May 29, 2019

I've pushed a change which fixes this, if you want to give it a try it is on the fixes branch. Thanks for the report, this will be part of 1.6.3.

@ralight ralight added the Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. label May 29, 2019
vankxr pushed a commit to vankxr/mosquitto that referenced this issue Aug 9, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 16, 2019
ralight added a commit that referenced this issue Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: mosquitto-clients Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Projects
None yet
Development

No branches or pull requests

2 participants