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
Improve node disconnect time #1491
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+100000000 for this
def739a
to
e7227ae
Compare
e7227ae
to
4574a4e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool if it works as expected 💯 🥇
This ensures that the broker is reachable. If provider doesn't provide network connectivity, all calls to the broker will fail, resulting in timeouts. There's a greater chance that it will work after the disconnect, because the initial connection dialog was established via broker using consumer's original network interface.
4574a4e
to
e9f65c7
Compare
e9f65c7
to
428e3ce
Compare
428e3ce
to
c3053e3
Compare
Codecov Report
@@ Coverage Diff @@
## master #1491 +/- ##
==========================================
+ Coverage 47.63% 47.81% +0.18%
==========================================
Files 282 284 +2
Lines 10725 10789 +64
==========================================
+ Hits 5109 5159 +50
- Misses 5226 5240 +14
Partials 390 390
Continue to review full report at Codecov.
|
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestBrokerConnector(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Would be better to have isolated unit test which doesn't start real nats server. Calling connector.Connect could assert that mock conn Open was called and is added to registry map. Also it could assert that after closing conn it's removed from registry.
- ReconnectAll is not tested. Again if mock conn is used it's enough to test if Check method is called.
- Tests would be much faster too.
Restore connections to broker after connect/disconnect.
Fixes: #1484