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

Settting per_listener_settings to true prevents LWT to be published #2332

Closed
datafoo opened this issue Oct 1, 2021 · 3 comments
Closed

Settting per_listener_settings to true prevents LWT to be published #2332

datafoo opened this issue Oct 1, 2021 · 3 comments
Labels
Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug
Milestone

Comments

@datafoo
Copy link

datafoo commented Oct 1, 2021

Consider these 2 simple configuration files:

mosquitto-1.conf:

per_listener_settings false
listener 1883
allow_anonymous true

mosquitto-2.conf:

per_listener_settings true
listener 1883
allow_anonymous true

I ran the same test with each of the 2 configuration files:

C:\Program Files\Mosquitto>mosquitto.exe -v -c mosquitto-1.conf
1633076034: mosquitto version 2.0.12 starting
1633076034: Config loaded from mosquitto-1.conf.
1633076034: Opening ipv6 listen socket on port 1883.
1633076034: Opening ipv4 listen socket on port 1883.
1633076034: mosquitto version 2.0.12 running
1633076036: New connection from 127.0.0.1:60376 on port 1883.
1633076036: New client connected from 127.0.0.1:60376 as mqtt-explorer-b4a4d88b (p2, c1, k60).
1633076036: No will message specified.
1633076036: Sending CONNACK to mqtt-explorer-b4a4d88b (0, 0)
1633076036: Received SUBSCRIBE from mqtt-explorer-b4a4d88b
1633076036:     # (QoS 0)
1633076036: mqtt-explorer-b4a4d88b 0 #
1633076036: Sending SUBACK to mqtt-explorer-b4a4d88b
1633076045: New connection from 10.177.26.40:60401 on port 1883.
1633076045: New client connected from 10.177.26.40:60401 as MQTT_FX_Client (p2, c1, k5, u'admin').
1633076045: Will message specified (7 bytes) (r1, q0).
1633076045:     STATE/MQTT_FX_Client
1633076045: Sending CONNACK to MQTT_FX_Client (0, 0)
1633076048: Client MQTT_FX_Client closed its connection.
1633076048: Sending PUBLISH to mqtt-explorer-b4a4d88b (d0, q0, r0, m0, 'STATE/MQTT_FX_Client', ... (7 bytes))
1633076053: Received DISCONNECT from mqtt-explorer-b4a4d88b
1633076053: Client mqtt-explorer-b4a4d88b disconnected.
1633076055: mosquitto version 2.0.12 terminating

Note the line Sending PUBLISH to mqtt-explorer-b4a4d88b (d0, q0, r0, m0, 'STATE/MQTT_FX_Client', ... (7 bytes))in this first test.

C:\Program Files\Mosquitto>mosquitto.exe -v -c mosquitto-2.conf
1633076059: mosquitto version 2.0.12 starting
1633076059: Config loaded from mosquitto-2.conf.
1633076059: Opening ipv6 listen socket on port 1883.
1633076059: Opening ipv4 listen socket on port 1883.
1633076059: mosquitto version 2.0.12 running
1633076061: New connection from 127.0.0.1:60402 on port 1883.
1633076061: New client connected from 127.0.0.1:60402 as mqtt-explorer-b4a4d88b (p2, c1, k60).
1633076061: No will message specified.
1633076061: Sending CONNACK to mqtt-explorer-b4a4d88b (0, 0)
1633076061: Received SUBSCRIBE from mqtt-explorer-b4a4d88b
1633076061:     # (QoS 0)
1633076061: mqtt-explorer-b4a4d88b 0 #
1633076061: Sending SUBACK to mqtt-explorer-b4a4d88b
1633076072: New connection from 10.177.26.40:60409 on port 1883.
1633076072: New client connected from 10.177.26.40:60409 as MQTT_FX_Client (p2, c1, k5, u'admin').
1633076072: Will message specified (7 bytes) (r1, q0).
1633076072:     STATE/MQTT_FX_Client
1633076072: Sending CONNACK to MQTT_FX_Client (0, 0)
1633076077: Client MQTT_FX_Client closed its connection.
1633076080: Received DISCONNECT from mqtt-explorer-b4a4d88b
1633076080: Client mqtt-explorer-b4a4d88b disconnected.
1633076082: mosquitto version 2.0.12 terminating

Note the lack of the LWT message in the logs. The LWT from client MQTT_FX_Client was not published in this test where per_listener_settings true.

My environment:

  • mosquitto version 2.0.12
  • Windows 10 Pro 21H1
@Elix-g
Copy link

Elix-g commented Oct 1, 2021

This issue has been recognized and the fixes branch already contains the resolution for this problem. Fix will be rolled out with release of version 2.0.13.

BR,
Elix

@Elix-g
Copy link

Elix-g commented Oct 1, 2021

@ralight ralight added Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. Type: Bug labels Oct 6, 2021
@ralight ralight added this to the 2.0.13 milestone Oct 6, 2021
@datafoo
Copy link
Author

datafoo commented Oct 7, 2021

Correct link is #2314

@datafoo datafoo closed this as completed Oct 7, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: mosquitto-broker 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

3 participants