Skip to content

Commit

Permalink
PTFE-1196 Make it easier to identify events related to missed webhooks (
Browse files Browse the repository at this point in the history
#497)

Adding a log statement to indicate when a new runner needs to be
created for a runner group due to a high time to start, and including
the name of the deleted idle runner in the log statement for the
healthcheck function.
  • Loading branch information
tcarmet authored Dec 11, 2023
1 parent 6c1196a commit 323c169
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion runner_manager/jobs/workflow_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def in_progress(webhook: WorkflowJobInProgress) -> str | None:
# in the case we have missed a webhook, we still have a runner
# available for the jobs that are requesting it.
if tts > settings.timeout_runner and runner_group.is_full is False:
log.info(f"Runner group {runner_group.name} needs a new runner")
log.info(
f"Time to start too high ({tts}), creating runner for {runner_group.name}"
)
github: GitHub = get_github()
runner_group.create_runner(github)
return runner.pk
Expand Down
2 changes: 1 addition & 1 deletion runner_manager/models/runner_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def healthcheck(
while len(idle_runners) > self.min:
runner = idle_runners.pop()
self.delete_runner(runner, github)
log.info(f"Runner {runner.name} deleted")
log.info(f"Deleted idle {runner}")

def reset(self, github: GitHub):
"""Reset runner group."""
Expand Down

0 comments on commit 323c169

Please sign in to comment.