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

qos 0 messages is not being sent to connected subscribers #2123

Closed
quackgizmo opened this issue Mar 8, 2021 · 1 comment
Closed

qos 0 messages is not being sent to connected subscribers #2123

quackgizmo opened this issue Mar 8, 2021 · 1 comment
Milestone

Comments

@quackgizmo
Copy link

A client subscribes to a topic, another client publishes two messages to that topic, one with qos 0 and one with qos 1, only the message with qos 1 is received by the first client.

It fails with the 2.0.8 version, but it used to work with the 1.6.12 version.

This is the mosquitto log.

1615196145: mosquitto version 2.0.8 starting
1615196145: Config loaded from /mosquitto/config/mosquitto.conf.  
1615196145: Opening ipv4 listen socket on port 1883.  
1615196145: Opening ipv6 listen socket on port 1883.
1615196145: mosquitto version 2.0.8 running
1615196205: Saving in-memory database to /mosquitto/data//mosquitto.db.
1615196266: Saving in-memory database to /mosquitto/data//mosquitto.db.
1615196274: New connection from 127.0.0.1:59246 on port 1883.
1615196274: New client connected from 127.0.0.1:59246 as subscriber (p2, c1, k60).
1615196274: No will message specified.
1615196274: Sending CONNACK to subscriber (0, 0)
1615196274: Received SUBSCRIBE from subscriber
1615196274: 	test/# (QoS 1)
1615196274: subscriber 1 test/#
1615196274: Sending SUBACK to subscriber
1615196309: New connection from 127.0.0.1:59248 on port 1883.
1615196309: New client connected from 127.0.0.1:59248 as publisher (p2, c1, k60).
1615196309: No will message specified.
1615196309: Sending CONNACK to publisher (0, 0)
1615196309: Received PUBLISH from publisher (d0, q1, r0, m1, 'test/qos1', ... (4 bytes))
1615196309: Sending PUBLISH to subscriber (d0, q1, r0, m1, 'test/qos1', ... (4 bytes))
1615196309: Sending PUBACK to publisher (m1, rc0)
1615196309: Received DISCONNECT from publisher
1615196309: Client publisher disconnected.
1615196309: Received PUBACK from subscriber (Mid: 1, RC:0)
1615196325: New connection from 127.0.0.1:59250 on port 1883.
1615196325: New client connected from 127.0.0.1:59250 as publisher (p2, c1, k60).
1615196325: No will message specified.
1615196325: Sending CONNACK to publisher (0, 0)
1615196325: Received PUBLISH from publisher (d0, q0, r0, m0, 'test/qos0', ... (4 bytes))
1615196325: Outgoing messages are being dropped for client subscriber.
1615196325: Received DISCONNECT from publisher
1615196325: Client publisher disconnected.
1615196328: Saving in-memory database to /mosquitto/data//mosquitto.db.
1615196369: Received PINGREQ from subscriber
1615196369: Sending PINGRESP to subscriber

The queues are not full, these two messages are the only ones being sent. So the Outgoing messages are being dropped for client subscriber seems a little strange.

This is the mosquitto configuration.

persistence true
persistence_location /mosquitto/data/
autosave_interval 60
max_inflight_messages 1000
max_inflight_bytes 134217728
max_queued_messages 100000
max_queued_bytes 268435456
allow_anonymous true
log_dest stdout
log_type all
connection_messages true
listener 1883

It can easily be reproduced by starting a subscriber with mosquitto_sub -h localhost -i subscriber -t test/# -q 1 -d -v. And then sending the two messages with mosquitto_pub -h localhost -i publisher -t test/qos1 -q 1 -m "test" -d and mosquitto_pub -h localhost -i publisher -t test/qos0 -q 0 -m "test" -d.

@ralight
Copy link
Contributor

ralight commented Mar 8, 2021

Thanks for the nice description. This is a regression on the max_*_bytes options for QoS 0 messages only. I've just pushed a fix for it which will be part of 2.0.9.

@ralight ralight added this to the 2.0.9 milestone Mar 8, 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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants