Skip to content

Commit

Permalink
Debug cml runner idle detection logic on GitHub (#925)
Browse files Browse the repository at this point in the history
* Fix `cml runner` idle detection logic on GitHub

* Simplify logic and cover edge case

What happens if job && idle or if !job && !idle? When in doubt, keep running.

* Remove stray whitespace

* Revert misled “fix” and clarify error messages
  • Loading branch information
0x2b3bfa0 authored Mar 29, 2022
1 parent f3406ac commit 6431f12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/cml/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,15 +278,19 @@ const runLocal = async (opts) => {

if (!job && !idle) {
winston.error(
`Runner should be idle. Resetting jobs. Retrying in ${idleTimeout} secs`
`Runner is idle as per the GitHub API but busy as per CML internal state. Resetting jobs. Retrying in ${idleTimeout} seconds...`
);
winston.warn(`CML GitHub driver response: ${JSON.stringify(job)}`);
winston.warn(
`CML internal state: ${JSON.stringify(RUNNER_JOBS_RUNNING)}`
);

RUNNER_JOBS_RUNNING = [];
}

if (job && idle) {
winston.error(
`Runner seems to be busy. Retrying in ${idleTimeout} secs`
`Runner is busy as per the GitHub API but idle as per CML internal state. Retrying in ${idleTimeout} seconds...`
);

idle = false;
Expand Down

3 comments on commit 6431f12

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Test Comment

CML watermark

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Test Comment

CML watermark

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Test Comment

CML watermark

Please sign in to comment.