Skip to content

Commit

Permalink
Revert backend leak check (#586)
Browse files Browse the repository at this point in the history
Reverting the backend leak check due to it killing healthy runners.
  • Loading branch information
tcarmet authored Apr 23, 2024
1 parent 1a9b2c8 commit 3a88a76
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 0 additions & 10 deletions runner_manager/models/runner_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,16 +313,6 @@ def healthcheck(
):
"""Healthcheck runner group."""
runners = self.get_runners()
backend_runners = self.backend.list()
# Check if there's a runner that is not in the database
if len(runners) != len(backend_runners):
for backend_runner in backend_runners:
if backend_runner not in runners:
# A runner has leaked from the database/runner manager
# let's save it and add it to the list of runners
backend_runner.save()
runners.append(backend_runner)

for runner in runners:
runner.update_from_github(github)
if runner.time_to_live_expired(time_to_live):
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/jobs/test_healthchecks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from hypothesis import given, settings
from hypothesis import strategies as st
from pytest import mark
from redis_om import Migrator
from rq import Queue

Expand Down Expand Up @@ -136,6 +137,7 @@ def test_healthcheck_job(
assert len(runner_group.get_runners()) == 1


@mark.skip(reason="The check was reverted due to killing healthy runners")
def test_healthcheck_backend_leak(
runner_group: RunnerGroup,
settings: Settings,
Expand Down

0 comments on commit 3a88a76

Please sign in to comment.