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

expiry is lost during restarts #1464

Closed
dustin opened this issue Oct 19, 2019 · 1 comment
Closed

expiry is lost during restarts #1464

dustin opened this issue Oct 19, 2019 · 1 comment
Milestone

Comments

@dustin
Copy link

@dustin dustin commented Oct 19, 2019

There are no timestamps shown here, but I did this interactively with a few seconds between interactions. I've got mosquitto running with the following bits of config:

autosave_interval 1
autosave_on_changes true
persistence_file mosquitto.db
persistence_location /tmp/

I run the following command:

mosquitto_pub -r -D publish message-expiry-interval 10 -t tmp/x -m hi1

While that's running, I restart mosquitto a couple times at a few seconds of interval. The following happens:

tmp/x → hi1
  MessageExpiryInterval 10
ERROR: MQTTException "disconnected"
tmp/x → hi1
  MessageExpiryInterval 4
ERROR: MQTTException "disconnected"
tmp/x → hi1
ERROR: MQTTException "disconnected"
tmp/x → hi1

Notice the expiry is gone and the message is permanently persistent. A few minutes later:

mqtt-watch tmp/#
tmp/x → hi1
@dustin

This comment has been minimized.

Copy link
Author

@dustin dustin commented Oct 19, 2019

Possibly related, also interesting:

dsal-macbookpro:mqtt dsal$ mqtt-watch tmp/#
tmp/x → hi1
  MessageExpiryInterval 10
^C
dsal-macbookpro:mqtt dsal$ mqtt-watch tmp/#
tmp/x → hi1
  MessageExpiryInterval 5
^C
dsal-macbookpro:mqtt dsal$ mqtt-watch tmp/#
tmp/x → hi1
  MessageExpiryInterval 2
^C
dsal-macbookpro:mqtt dsal$ mqtt-watch tmp/#
tmp/x → hi1
^C
dsal-macbookpro:mqtt dsal$ mqtt-watch tmp/#
[no message]

I restarted the client a few times. Around the time it should expire, it sent me the message with no properties. After that, the message was gone.

ralight added a commit that referenced this issue Oct 31, 2019
They would be be sent without an expiry interval property just before
they were expired.

Closes #1464. Thanks to Dustin Sallings.
@ralight ralight added this to the 1.6.8 milestone Oct 31, 2019
@ralight ralight closed this in 06a27e7 Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.