-
Notifications
You must be signed in to change notification settings - Fork 220
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
Client supplied ID is used to look up existing clients in inheritSession, while the store of existing actually uses the server assigned if one exists. #416
Comments
I think I found the issue. Whether or not this is a 'bug', or a misunderstanding of assigning client IDs, yet to be determined 😅 The problem: So I think this happens:
|
I will work on a PR that does this: If client has an assigned client identifier, use that to look up existing clients, instead of the client-defined client id. In the meantime let me know if there is a more appropriate fix. |
Will open a PR shortly. |
I realized a few reasons why this may not have manifested to others before:
|
|
But now you are making me wonder if I should swap the PR back to the original implementation before I changed it, which is just using Rather than do the If check on the Edit I updated #417 and its description |
I feel using cl.ID in inheritClientSession is reasonable. However, this is mutable, perhaps that's the reason @mochi-co used the pk.Connect.ClientIdentifier instead. Let's hear from him if he's ok to change that to use cl.ID. |
@thedevop @SimonMacIntyre I think this is a good move. Originally I used |
I am still debugging and investigating this, so hopefully it is not human error. Figured I would post in case anyone else is experiencing it or able to easily reproduce it.
Happens to me on versions
> 2.6.0
, I did not test lower than that because my code is not compatible without some changes, so I decided to try to investigate the issue (or my misconfiguration).I am using protocol version 5 clients (mqttjs, specifically).
Here is my server config:
Here is my client settings:
Here is a screenshot of both my client simultaneously connected, and not being forcefully disconnected (also no client takeover occurred according to my logs.
Now if I publish a message, only one of them gets it (the latest to connect I think). Now this does seem like a client takeover.
So the 2 issues are:
Here is the code I am using to do that which used to work I think in older versions:
On the metrics page I can see:
Which is my 2 clients. Since its not being disconnected I guess is why the client stop isn't being detected. What's also interesting is the
subscriptions
count is actually only1
. Also when I ctrl+c the 2 terminals with the connections, I get the debug log of each disconnecting (and using the same client id).So the root of the issue I think is the lack of the disconnect.
I'll try to see if I can find a fix or where the issue is!
The text was updated successfully, but these errors were encountered: