Skip to content

Commit 6431f12

Browse files
authored
Debug cml runner idle detection logic on GitHub (#925)
* 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
1 parent f3406ac commit 6431f12

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/cml/runner.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,19 @@ const runLocal = async (opts) => {
278278

279279
if (!job && !idle) {
280280
winston.error(
281-
`Runner should be idle. Resetting jobs. Retrying in ${idleTimeout} secs`
281+
`Runner is idle as per the GitHub API but busy as per CML internal state. Resetting jobs. Retrying in ${idleTimeout} seconds...`
282+
);
283+
winston.warn(`CML GitHub driver response: ${JSON.stringify(job)}`);
284+
winston.warn(
285+
`CML internal state: ${JSON.stringify(RUNNER_JOBS_RUNNING)}`
282286
);
283287

284288
RUNNER_JOBS_RUNNING = [];
285289
}
286290

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

292296
idle = false;

0 commit comments

Comments
 (0)