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

server_name with Space characters breaks reply routing for leaf nodes. #5633

Closed
codegangsta opened this issue Jul 9, 2024 · 1 comment · Fixed by #5676
Closed

server_name with Space characters breaks reply routing for leaf nodes. #5633

codegangsta opened this issue Jul 9, 2024 · 1 comment · Fixed by #5676
Labels
defect Suspected defect such as a bug or regression

Comments

@codegangsta
Copy link
Contributor

Observed behavior

When setting server_name to a string with a " " in it, like "My Server", results in replies not being delivered to a requestor, when the requestor lives on the hub and the replier living on a leaf node.

Expected behavior

I would expect it to work as intended or throw a validation error/warning when trying to connect as a leaf node.

Server and client version

nats-server - 2.10.17
nats-cli - (devel) main

Host environment

MacOS on M1 Mac studio for leaf node, Synadia Cloud for hub.

Steps to reproduce

  1. Create a leaf node that connects into a hub (any sort of auth works fine here)
  2. Set the server_name of the leaf node to "My Server" (or anything with a space on it)
  3. Add a replier to the leaf node nats reply hello.world --echo --context leaf
  4. Make a request from the hub nats req hello.world hihi --context hub
  5. Observe that the request is received by the leaf node client, but the reply is never sent.

When the server_name has no spaces, I don't encounter this issue

@codegangsta codegangsta added the defect Suspected defect such as a bug or regression label Jul 9, 2024
@Jarema
Copy link
Member

Jarema commented Jul 9, 2024

I think throwing validation error would be a better solution here, as spaces are troublesome, especially in NATS context.
Such validation could be considered technically breaking, but at the system that already does not properly work, so not sure if that can break any proper systems.

kozlovic added a commit that referenced this issue Jul 19, 2024
Having cluster name with spaces in the context of a leaf node could
cause problems when a subscription on the leaf node would be propagated
in the cluster's hub.

Since when a gateway is specified the name of the gateway needs to
match the name of the cluster, the restriction of "no spaces" is
added to gateway name.

Finally, in the case of the leafnode, if no cluster name is specified
the server name is used, so also applying the restriction to the
server name.

Resolves #5633

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
kozlovic added a commit that referenced this issue Jul 19, 2024
Having cluster name with spaces in the context of a leaf node could
cause problems when a subscription on the leaf node would be propagated
in the cluster's hub.

Since when a gateway is specified the name of the gateway needs to match
the name of the cluster, the restriction of "no spaces" is added to
gateway name.

Finally, in the case of the leafnode, if no cluster name is specified
the server name is used, so also applying the restriction to the server
name.

Resolves #5633

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
wallyqs pushed a commit that referenced this issue Jul 19, 2024
Having cluster name with spaces in the context of a leaf node could
cause problems when a subscription on the leaf node would be propagated
in the cluster's hub.

Since when a gateway is specified the name of the gateway needs to
match the name of the cluster, the restriction of "no spaces" is
added to gateway name.

Finally, in the case of the leafnode, if no cluster name is specified
the server name is used, so also applying the restriction to the
server name.

Resolves #5633

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
2 participants