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

Websocket connection doesn’t get messages on subscription after terminated reconnect #645 #1227

Closed
usernametaken opened this issue Apr 15, 2019 · 4 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

@usernametaken
Copy link

  1. I am running mosquitto 1.5.8 (Windows)
  2. I am connecting using websockets
  3. I am having a similar issue to Websocket connection doesn’t get messages on subscription after terminated reconnect #645 (Websocket connection doesn’t get messages on subscription after terminated reconnect #645)
  4. I connect with a Fixed ClientID
  5. CleanSession = False (with CleanSession = True ... no problem)
  6. QoS is irrelevant to the problem (I tried all levels)

a) I start my application connect, subscribe and publish... everything works fine
b) I kill my application without sending a DISCONNECT first
> Socket error on client Client1, disconnecting
Everything works fine

c) I send a DISCONNECT before disconnecting :-( The problem starts
After Reconnecting , and subscribing to the same Topic,
I don't receive PUBLISHed messages anymore
d) If I kill my client application and start again.... It still does not work.
e) If I stop and restart mosquitto ... reconnect and subscribe (with or without restarting the client)... everything works.

Doing the same with a TCP client... all works fine

@ralight
Copy link
Contributor

ralight commented Apr 16, 2019

Thanks for the easy to follow steps. I confirm this is behaving as you state. It's a bit involved to fix, so won't be part of 1.6.

@usernametaken
Copy link
Author

Thanks... I am fine for now.
As a workaround I just don't send DISCONNECT before disconnecting, if CleanSession is false,
... I simply close the socket.

@ralight
Copy link
Contributor

ralight commented Apr 16, 2019

Yes that works - as long as you don't want to control whether a Will is sent or not, which is why I didn't suggest it as the solution.

@ralight
Copy link
Contributor

ralight commented May 28, 2019

I've just pushed a fix for this to the fixes branch. If you feel you can give it a try and report back that would be great. It turns out the fix wasn't as involved as I thought, which is good.

@ralight ralight added this to the 1.6.3 milestone May 28, 2019
@ralight ralight added the Status: Completed Nothing further to be done with this issue, it can be closed by the requestor or committer. label May 29, 2019
vankxr pushed a commit to vankxr/mosquitto that referenced this issue Aug 9, 2019
This occurs after they reconnect, having sent DISCONNECT
on a previous session.

Closes eclipse#1227. Thanks to usernametaken.
@lock lock bot locked as resolved and limited conversation to collaborators Sep 16, 2019
ralight added a commit that referenced this issue Sep 18, 2019
This occurs after they reconnect, having sent DISCONNECT
on a previous session.

Closes #1227. Thanks to usernametaken.
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