Skip to content
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: Move service shutdown logic to each service #27690

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented Jan 4, 2023

Proposed changes (including videos or screenshots)

Issue(s)

ARCH-120

Steps to test or reproduce

Further comments

@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #27690 (5a953b3) into develop (1fecf0f) will decrease coverage by 0.06%.
The diff coverage is n/a.

❗ Current head 5a953b3 differs from pull request most recent head bbac6ca. Consider uploading reports for the commit bbac6ca to get more accurate results

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #27690      +/-   ##
===========================================
- Coverage    42.01%   41.96%   -0.06%     
===========================================
  Files          844      811      -33     
  Lines        17751    17158     -593     
  Branches      2009     1908     -101     
===========================================
- Hits          7458     7200     -258     
+ Misses       10029     9719     -310     
+ Partials       264      239      -25     
Flag Coverage Δ
e2e 41.96% <ø> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

const firstNode = nodes.sort().shift();

// if the first node is the current node and there are others nodes running the same service, then it should shutdown
return firstNode === this.broker.nodeID && nodes.length > 0;
Copy link
Contributor

@geekgonecrazy geekgonecrazy Jan 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in rare cases.. this might depend on outside orchestrator to pop a node back online? Lets say if there are 2 nodes and both happen to perform this check and make decision at same time

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, that's what the sort tries to solve.. if 2 nodes online performing the check at the same time, the "first node" will be the same for both, that means only one of them will shut down.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it! That makes sense 👍

@rodrigok rodrigok self-requested a review January 9, 2023 12:08
@ggazzo ggazzo merged commit 0a4d061 into develop Jan 23, 2023
@ggazzo ggazzo deleted the change-service-shutdown-logic branch January 23, 2023 18:05
gabriellsh added a commit that referenced this pull request Jan 23, 2023
…etChat/Rocket.Chat into matrixSearch

* 'feat/federation-search-public-rooms' of github.com:RocketChat/Rocket.Chat:
  Chore: Move service shutdown logic to each service (#27690)
  Chore: change colors to dark theme on Marketplace (#27532)
  Chore: Update color tokens (#27704)
  Chore: Remove medium prop from ButtonGroup  (#27784)
  Regression: Add support for 2FA errors to `Meteor.callAsync` (#27767)
  [NEW] Attachment Files Redesign (#27470)
  [FIX] App page showing version undefined for apps not in marketplace (#27766)
  Chore: Add surface-light background to AppRow (#27765)
@sampaiodiego sampaiodiego mentioned this pull request Feb 17, 2023
@sampaiodiego sampaiodiego mentioned this pull request Mar 9, 2023
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants