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

$SYS/broker/version is no longer published in 1.6.1 #1245

Closed
ckrey opened this issue Apr 29, 2019 · 5 comments
Closed

$SYS/broker/version is no longer published in 1.6.1 #1245

ckrey opened this issue Apr 29, 2019 · 5 comments
Milestone

Comments

@ckrey
Copy link

ckrey commented Apr 29, 2019

with default or explicit sys_interval > 0

  • #sys_interval 10
  • sys_interval 10
@ralight
Copy link
Contributor

ralight commented Apr 29, 2019

It works for me, do you have any other config? I used ./mosquitto on its own, or ./mosquitto -c m.conf, where m.conf was just

sys_interval 10

@ckrey
Copy link
Author

ckrey commented Apr 30, 2019

I tracked the problem down to the use of

check_retain_source true

$SYS/broker/version is not published if check_retain_source is true, but is published if false.

When check_retain_source is not explicitly set the result is unpredictable(*) because I see no
initialization of config->check_retain_source in conf.c.

(*) I have two systems, one on Debian, one running Centos which behave differently with the same config

@ckrey
Copy link
Author

ckrey commented Apr 30, 2019

If you want an example on a server you control:

$ mosquitto_sub -t '$SYS/broker/+' -v -h test.mosquitto.org
$SYS/broker/uptime 407352 seconds

@ralight
Copy link
Contributor

ralight commented Apr 30, 2019

test.mosquitto.org spends a lot of time running under valgrind, I'm sure it would have come up if check_retain_source wasn't being initialised. The first line of config__init should clear check_retain_source:

memset(config, 0, sizeof(struct mosquitto__config));

When the config is reloaded memset is used as well.

I confirm the behaviour with check_retain_source set to true.

Did you compile the Debian/Centos packages manually, or if not where were they from?

@ralight ralight added this to the 1.6.2 milestone Apr 30, 2019
@ralight
Copy link
Contributor

ralight commented Apr 30, 2019

Aha! You've spotted two bugs here. The first is around check_retain_source, the second is that $SYS/broker/version was being expired after 60 seconds. This explains the different behaviour you've seen.

@ralight ralight closed this as completed Apr 30, 2019
ralight added a commit that referenced this issue Apr 30, 2019
This occurred when `check_retain_source` was set to true.

Closes #1245. Thanks to Christoph Krey.
ralight added a commit that referenced this issue Apr 30, 2019
ccvca pushed a commit to ccvca/mosquitto that referenced this issue May 1, 2019
This occurred when `check_retain_source` was set to true.

Closes eclipse#1245. Thanks to Christoph Krey.
ccvca pushed a commit to ccvca/mosquitto that referenced this issue May 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 7, 2019
ralight added a commit that referenced this issue Sep 18, 2019
This occurred when `check_retain_source` was set to true.

Closes #1245. Thanks to Christoph Krey.
ralight added a commit that referenced this issue Sep 18, 2019
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