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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prune dead members on startup #79

Merged
merged 1 commit into from
Jul 21, 2023
Merged

Conversation

devppjr
Copy link
Contributor

@devppjr devppjr commented Jul 20, 2023

When remotecv is killed in kubernetes/docker the environment stay with dead members instances. So this PR aims to add a prune dead members configuration to avoid this problem.

continuation of #78 馃槵

@coveralls
Copy link

coveralls commented Jul 20, 2023

Pull Request Test Coverage Report for Build 5616199244

  • 6 of 6 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 88.11%

Totals Coverage Status
Change from base Build 5600008766: 0.2%
Covered Lines: 465
Relevant Lines: 553

馃挍 - Coveralls

@devppjr devppjr force-pushed the prune-dead-members-on-startup branch from a6b0177 to 0b07e46 Compare July 20, 2023 19:08
Comment on lines 129 to 141
def test_should_prune_dead_members_on_startup(self):
config.prune_dead_members = True
worker = UniqueWorker(server=self.redis, queues=["Detect"])

self.redis.sadd("resque:workers", "teste1")
members = self.redis.smembers("resque:workers")
expect(len(members)).to_equal(2)

worker.startup()

members = self.redis.smembers("resque:workers")
expect(len(members)).to_equal(1)
expect(str(worker).encode() in members).to_be_true()
Copy link
Member

@scorphus scorphus Jul 20, 2023

Choose a reason for hiding this comment

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

Aren't we missing a test_should_not_prune_dead_members_on_startup? I think it's important to check both conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@scorphus Makes sense, what do you think of the test?

@devppjr devppjr force-pushed the prune-dead-members-on-startup branch from 0b07e46 to 673d4bd Compare July 20, 2023 21:46
@codeclimate
Copy link

codeclimate bot commented Jul 20, 2023

Code Climate has analyzed commit 673d4bd and detected 0 issues on this pull request.

View more on Code Climate.

@devppjr devppjr requested a review from scorphus July 20, 2023 21:52
Copy link
Member

@scorphus scorphus left a comment

Choose a reason for hiding this comment

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

So far so good. Expect a couple follow-up PRs from yours truly.

@devppjr devppjr merged commit db87321 into master Jul 21, 2023
23 checks passed
@devppjr devppjr deleted the prune-dead-members-on-startup branch July 21, 2023 14:17
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.

None yet

4 participants