Comments (5)
Hi @krumts , thanks for super detailed investigation and summary of issue, this helped a lot.
Seems the combination of infinite reconnects (:max_reconnect_attempts: -1
) and uncaught exceptions is making the client get stuck trying to reconnect without backing off each time, and agree that should be handled more gracefully.
Have a branch in the works where the client would not get stuck as in this case, so that the exception is raised instead, let me know if you have any feedback too. Thanks!
https://github.com/nats-io/ruby-nats/compare/time-based-reconnect-backoff
from nats.rb.
Hi @wallyqs , thanks for the quick reply! Nice to see that the investigation was helpful.
I tried running my test locally with the changes in client.rb, and the endless loop did not appear again.
However, I just had a look at the changes, and believe there is one error in the condition here:
https://github.com/nats-io/ruby-nats/compare/time-based-reconnect-backoff#diff-ef391b2fe211800bc221ab248b46db86R819
As it is now, both the if and else blocks return true.
If I understand the code properly, in case the if condition is fulfilled (time since last reconnect is greater than the configured one?), then false should be returned, meaning no delay is needed. Is this so?
Thanks again!
from nats.rb.
good catch, that's definitely a bug... 😓
thanks for taking a look!
from nats.rb.
@krumts Fix is in master and will prepare a release including the change soon, thanks again.
from nats.rb.
@krumts pushed earlier a version of the gem which has this fix now: https://rubygems.org/gems/nats/versions/0.8.2
from nats.rb.
Related Issues (20)
- support custom certs in TLS HOT 1
- SRV record support HOT 2
- correctly handling retries HOT 5
- timing issue around @pending queue HOT 4
- unneeded dependencies HOT 4
- Further concurrency related corruption in @pending HOT 3
- Support for NATS Streaming HOT 6
- allow discovery of servers to be disabled HOT 6
- undefined method `<<' for nil:NilClass HOT 2
- Replied data might be lost in request-reply processing. HOT 2
- update eventmachine HOT 1
- Compiled binary? HOT 2
- Ruby NATS client doesn't verify hostname when connecting over TLS HOT 2
- Nats server closed connection with Stale Client Connection HOT 1
- TLS Peer verification: `ssl_verify_peer` does not support multiple CAs HOT 9
- TLS connection error `oversize record received` HOT 9
- Fix IPv6 address being sent to `gethostname` still containing []'s
- does not resend auto unsubscribe with updated value
- Support NATS JetStream HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nats.rb.