question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Clients hangs when trying to connect to a URL that is not NATS

See original GitHub issue

Malformed 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:closed
  • Created 4 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
per-ovecommented, Nov 25, 2019

@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.

1reaction
ColinSullivan1commented, Nov 25, 2019

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 to nats://. It shouldn’t break any existing deployments.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found