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
[FIXED] MQTT fixes and improvements #2178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - But I have limited familiarity with the code
Some issues that have been fixed would manifest by timeouts on connect, unexpected memory usage on high publish message rate. Some details: - Replies were not always GW routed properly because we were looking at the wrong connection's rsubs - GW routed replies would not be found because they were tracked in the subscription's client object, which may not be the same used to send the reply - Increased the mqtt timeout to wait for JS replies since in some tests it was sometimes taking more than the original 2 seconds - Incoming gateway messages destined for an MQTT internal subscription may have been rejected as a no interest if the account had service imports - Don't use time.After(), instead create explicit timer so it can be stopped when not timing out. - Unnecessary copy of a slice since we were converting to a string anyway. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
@derekcollison I have been reworking all that quite a bit and rebased from main, sorry about that. The main change has been to keep the gw reply mapping in the client object for CLIENT connections, and to account for others. I have extracted the client's gwrm/cgwrt to its own struct so that code can be reused between client/account, etc.. |
This will solve the issue of naming the durable per server for the "retained messages" stream in situation where a cluster of servers would not have JetStream defined but connect to another cluster that has it. All the servers within the cluster without JetStream would cause the durable's delivery subject to be updated to the last server starting the durable. Updated the check for mqtt requiring JetStream if running in standalone mode to check that no leafnode configuration is present. Replaced use of fmt.Errorf() when the string was static with errors created with errors.New(). Updated tests that were checking for errors to use those errors instead of repeating the string. Added test that has a hub cluster with JS enabled and a remote server that has mqtt{} without JetStream and ensure that this works. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Some issues that have been fixed would manifest by timeouts on
connect, unexpected memory usage on high publish message rate.
Some details:
at the wrong connection's rsubs
in the subscription's client object, which may not be the same used
to send the reply
tests it was sometimes taking more than the original 2 seconds
may have been rejected as a no interest if the account had service imports
be stopped when not timing out.
Signed-off-by: Ivan Kozlovic ivan@synadia.com