Open gollux opened 2 years ago
There were fixes about bridge reconnection in 2.0.13, so I recommend updating to 2.0.14 and retesting. (I'm not a maintainer of mosquitto, but when acting of maintainer of other things, I basically decline to address bugs in other than the latest release.)
It sounds like firing up gdb would be useful.
Sorry, my typo. It was 2.0.14. Just to be sure, I re-tested it again today with freshly downloaded 2.0.14 and the bug still persists.
I have the same issue using the function mosquitto_loop()
with version 2.0.11 and openssl 1.1.1k. The function mosquitto_loop()
returns with MOSQ_ERR_SUCCESS
immediately after calling. So, according to mosquitto_loop()
everything is OK, but errno
is set to EPIPE
.
The according strace output is:
[pid 11935] pselect6(14, [7 13], [], NULL, {tv_sec=1, tv_nsec=0}, {NULL, 8}) = 1 (in [13], left {tv_sec=0, tv_nsec=999986959})
[pid 11935] write(13, "\26\3\1\1(\1\0\1$\3\3q\244\340\6\216NYJ<|\212\232&\\\361\nV\1\217*/"..., 301) = -1 EPIPE (Broken pipe)
[pid 11935] --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=11931, si_uid=0} ---
I am trying to write a simple program, which listens for MQTT messages and which can recover from server failures. I am using this:
Now, if the server is available, everything works correctly. But once I run this program with no server running, it gets stuck in an infinite loop:
If I turn off TLS,
mosquitto_loop_forever()
correctly detects that the connection is broken and reconnect after some delay.I used
mosquitto-1.5.7
from Debian Buster, but unmodified version 2.0.11 behaves the same. I am using openssl 1.1.1d as a SSL library.