-
-
Notifications
You must be signed in to change notification settings - Fork 587
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
debounced localServiceChanged breaking with NATS #1185
Comments
A fix could be something like?
EDIT: This snippet does fix the issue, but IDK exactly how to create an unit test case for that. If you guys give me the guidance, I can do it. |
This would be really helpful 🚀 |
@alvaroinckot nice catch, please open a PR with your fix. Currently, there is no integration test for balancing logic, only unit tests. So for me, it's enough if you add a unit test for the fix and we can check manually with the repro code. |
🛑 Do you want to ask a question ?
Please head to the Discord chat
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Current Behavior
Using NATS, if a
ServiceBroker
with internal services enabled gets stopped during a service change process, it proceeds with theunsubscribeFromBalancedCommands
and fails as the NATS client was already flushed in the stop process.It is very likely to happen during integration tests or when scaling up and down nodes.
Expected Behavior
When the
ServiceBroker
is stopped, the bounced service change process should be interrupted.Failure Information
I was able to reproduce it only with NATS, and line of code in the
service-broker.js
file causing it should be:this.localServiceChanged = _.debounce(() => origLocalServiceChanged.call(this), 1000);
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
Reproduce code snippet
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
The text was updated successfully, but these errors were encountered: