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

Retained publish not fully processed when connection closes ungracefully #341

Open
xadh00m opened this issue Jun 2, 2022 · 3 comments
Open
Labels
question Further information is requested

Comments

@xadh00m
Copy link

xadh00m commented Jun 2, 2022

Expected behavior

If a client publish message (retained, QoS 0,1,2) reaches the broker it should be forwarded to subscribers, the topic should be updated and plugin interceptors should be called even if the client connection closes ungracefully.

Actual behavior

The message is forwarded to subscribers but the topic is not updated and plugin interceptors are not called if the client connection closes ungracefully.

To Reproduce

We can reproduce the issue with the MQTT.js client in Firefox:

window.onbeforeunload = (event) => {  // called by the browser when the webpage closes
  event.preventDefault()
  mqttClient.publish("topic", "payload", { retain: true })
  return ""
}

Details

  • Affected HiveMQ CE version(s): 2021.3-CE container image
@DC2-DanielKrueger DC2-DanielKrueger added the bug Something isn't working label Oct 20, 2022
@DC2-DanielKrueger
Copy link
Contributor

@xadh00m

What do you mean with "the topic is not updated"?

@DC2-DanielKrueger DC2-DanielKrueger added question Further information is requested and removed bug Something isn't working labels Oct 20, 2022
@xadh00m
Copy link
Author

xadh00m commented Oct 20, 2022

Hi @DC2-DanielKrueger,

The retained topic of the broker is not updated. Which means a new subscription to the topic returns the old value. The new value, which has been sent to the previous subscribers, is not retained..

@DC2-DanielKrueger
Copy link
Contributor

I could not reproduce this by closing the channel right after the publish was sent. Do you know what the js client actually does? Does it sent a DISCONNECT or closes the tcp channel with FIN packet? Is the problem occurring consistently or rather flaky?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants