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

Broker does not always exit cleanly on Windows #3147

Open
ronaldsipkema opened this issue Oct 29, 2024 · 0 comments
Open

Broker does not always exit cleanly on Windows #3147

ronaldsipkema opened this issue Oct 29, 2024 · 0 comments

Comments

@ronaldsipkema
Copy link

I'm running the mosquitto broker on Windows in a test setup, and noticed the broker does not always exit cleanly. I tried both version 2.0.18 and 2.0.20. The problem seems to occur when the following criteria are met (at broker shutdown):

  • a client with a last will defined is connected to the broker;
  • a client (or bridge setup) with a subscription on this last will topic is also connected.

Where I would normally get the following to last log lines:

mosquitto version 2.0.20 terminating
Saving in-memory database to mosquitto.db.

I now (i.e., with client that has a last will and another subscriber to this last will topic) get the following:

mosquitto version 2.0.20 terminating
Sending PUBLISH to subscriber-client-id (d0, q1, r0, m9, 'last/will/topic', ... (26 bytes))

The exit code of the process (%errorlevel%) is -1073741819. It looks like the broker stops working properly while trying to send the last will messages. The interested subscriber does not receive the last will message of the other client. As a result of this bug, the persistence database is also not written to disk.

I did a quick test on Linux (Debian bookworm on WSL, mosquitto 2.0.20 from bookworm-backports), and there the problem does not exist (even though it shows some error messages in the log): the subscriber does get the last will mesagge and the persistence database is saved properly:

mosquitto version 2.0.20 terminating
Sending PUBLISH to subscriber-client-id (d0, q1, r0, m10, 'last/will/topic', ... (26 bytes))
Error in epoll re-registering to EPOLLOUT: Invalid argument
Error in epoll re-registering to EPOLLIN: Invalid argument
Saving in-memory database to mosquitto.db.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants