Clients hangs when trying to connect to a URL that is not NATS
See original GitHub issueMalformed URL throws exception but if you accidentally enter an URL that is valid but not nats-server the call hangs.
Steps to reproduce:
var cf = new ConnectionFactory();
var opts = ConnectionFactory.GetDefaultOptions()
opt.Servers = new[] {a valid URL to a web server e.g. http://localhost}
try
{
var conn = cf.CreateConnection(opts)
}
catch(Exception ex)
{
// Some Action
}
Actual Result: Code hangs no exception thrown. Expected Result: Exception thrown
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Automatic Reconnections - NATS Docs
All the client libraries maintained on the nats.io GitHub page will automatically attempt to re-connect if their current server connection gets disconnected ...
Read more >What does it mean if SSH hangs after `Connection ...
If the connection hangs here, it's because the client hasn't received the version string from the server. In general there are several things ......
Read more >Why do consoles sometimes hang forever when SSH ...
The long-hang behavior on communication issues is not a bug, the SSH session is hanging out hoping the other side will come back....
Read more >curl hangs after client hello - ssl
In my specific case, i was behind two router, trough two nat rules one behind the other. When the packet arrived on the...
Read more >Troubleshoot your Application Load Balancers
Clients cannot connect to an internet-facing load balancer. If the load balancer is not responding to requests, check for the following issues: Your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danielwertheim About other improvement. For our use case we see no need for such an option. And if we can trust the handshake to report errors we are very satisfied.
I think there’s value in throwing an exception on an invalid protocol - it’d help users more quickly identify a problem. We could accept
nats://
,tls://
(which sets up a secure connection, like go), and just empty that defaults tonats://
. It shouldn’t break any existing deployments.