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

Inconsistency in PUBLISH received in $SYS #2448

Closed
Happy-Funtimes opened this issue Feb 3, 2022 · 2 comments
Closed

Inconsistency in PUBLISH received in $SYS #2448

Happy-Funtimes opened this issue Feb 3, 2022 · 2 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

@Happy-Funtimes
Copy link

Hi!

Some of the statistics reported by the tool ($SYS/broker/publish/messages/received and $SYS/broker/load/publish/received/+) are ignoring publishes with QoS 2 or the retain flag.

According to the documentation on the webpage: 'The total number of PUBLISH messages received since the broker started.'.

The cause seems to be that within lib/packet_mosq.c, it only gets added if it matches the PUBLISH control packet 0x30 after applying a bitmask of 0xF5. To my understanding the bitmask should be either 0xF0 or maybe even 0xF8. The reason being that it should only check the first nibble to see if it is the proper control type (publish == 0x3X) and maybe make sure that it isn't a duplicate (0x08).

Currently the 0xF5 bitmask will essentially mean that retain bits and QoS 2 messages will not be recognized and therefore not included in the system statistics.

I may be misunderstanding its purpose, but wanted to raise it as a point of concern as my instance is reporting next to no publishes received despite receiving regular messages.

@Happy-Funtimes Happy-Funtimes changed the title Inconsistency un PUBLISH received in $SYS Inconsistency in PUBLISH received in $SYS Feb 3, 2022
@Happy-Funtimes
Copy link
Author

Happy-Funtimes commented Feb 3, 2022

After testing different search terms I found the issue report I was looking for with 79339ce

My instance isn't running the latest version so it may have gotten fixed but in the latest version I'm still seeing the 0xF5 mask on line 549 so can't confirm if completely resolved

@ralight
Copy link
Contributor

ralight commented Aug 7, 2022

I think this is a throwback from veeerry old versions when library callbacks treated qos 0 messages differently, and it must have been pasted across. Nice spot, thank you!

@ralight ralight added Type: Bug Component: mosquitto-broker Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. labels Aug 7, 2022
@ralight ralight added this to the 2.0.15 milestone Aug 7, 2022
ralight added a commit that referenced this issue Aug 7, 2022
@ralight ralight closed this as completed Aug 12, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 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

2 participants