-
Notifications
You must be signed in to change notification settings - Fork 11k
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
chore: makes instance-status works along with Moleculer lifecyle #34134
Conversation
Looks like this PR is ready to merge! 🎉 |
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #34134 +/- ##
========================================
Coverage 75.83% 75.83%
========================================
Files 511 511
Lines 22171 22171
Branches 5397 5397
========================================
Hits 16813 16813
Misses 4710 4710
Partials 648 648
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Proposed changes (including videos or screenshots)
This PR removes the use of MongoDB Change Streams on
instance-status
package. The removal of Change Stream items is part of an initiative started earlier this year, but resources related toinstance-status
were still pending.instance-status
is responsible for ensuring the connection and heartbeat between instances in a multi-instance monolithic Rocket.Chat deployment.Since the Moleculer framework is already in use, we moved the lifecycle management of connections to it, such as node initialization, listing, etc.
As a result, it is no longer necessary to ping MongoDB and wait for a Change Stream notification to interpret a given node as valid.
The same timeout and heartbeat interval rules have been added to Moleculer:
process.env.MULTIPLE_INSTANCES_PING_INTERVAL || 10
process.env.MULTIPLE_INSTANCES_EXPIRE || Math.ceil((defaultPingInterval * 3) / 60) * 60
Issue(s)
Steps to test or reproduce
To validate these changes, you will need to run a multi-instance monolithic Rocket.Chat deployment.
Navigate to the
apps/meteor
directory and run the following command to start the first instance:cd apps/meteor TEST_MODE=true CI=true DISABLE_DB_WATCHERS=true meteor
Navigate to the build directory and execute the following:
This setup runs multi-instance communication using the TCP transporter. If you prefer to use NATS, you’ll need to include the NATS_TRANSPORTER environment variable. However, the changes primarily affect TCP connections.
Further comments