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

Bug in URL Normalization from List in client.py class #556

Open
OnSuorce opened this issue May 7, 2024 · 0 comments
Open

Bug in URL Normalization from List in client.py class #556

OnSuorce opened this issue May 7, 2024 · 0 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@OnSuorce
Copy link

OnSuorce commented May 7, 2024

Observed behavior

Currently, if you try to connect by passing a list of incomplete URLs (e.g., ["nats://nats", "nats://nats-1", "nats://nats-2"] or ["nats", "nats-1", "nats-2"]), the client fails to connect, while connecting using just one of the items from the list is successful.

Expected behavior

Essentially, when a URL is passed as a single string, it gets normalized, but when taken from a list, this does not happen.

Server and client version

NATS server (Docker image): 2.10.14
NATS Python client: 2.7.2

Host environment

Host environment not relevant

Steps to reproduce

Writing incomplete URLs as below will result in a connection refused exception

options = {
            "servers": ["nats", "nats-1", "nats-2"],
            "max_reconnect_attempts": 10,
            "reconnect_time_wait": 2
        }
await self.nc.connect(**options)

The following code snippets will run fine:

"servers": ["nats://nats:4222", "nats://nats-1:4222", "nats://nats-2:4222"],
"servers": "nats-1",
@OnSuorce OnSuorce added the defect Suspected defect such as a bug or regression label May 7, 2024
@OnSuorce OnSuorce changed the title Bug in URL Normalization from List in NatsClient class Bug in URL Normalization from List in client.py class May 7, 2024
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
Projects
None yet
Development

No branches or pull requests

1 participant