Skip to content

Commit

Permalink
Improve logging for remote tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie committed Oct 13, 2021
1 parent a1c662d commit bfe5e8f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
24 changes: 10 additions & 14 deletions cylc/flow/task_remote_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,13 @@ def construct_remote_tidy_ssh_cmd(
continue
if install_target == get_localhost_install_target():
continue
platform = get_random_platform_for_install_target(install_target)
try:
platform = get_random_platform_for_install_target(
install_target
)
cmd, host = construct_remote_tidy_ssh_cmd(platform)
except (NoHostsError, PlatformLookupError) as exc:
LOG.warning(
f"remote tidy on {platform['name']}: "
f"{TaskRemoteMgmtError.MSG_TIDY}\n{exc}"
)
LOG.warning(f"{exc}; {TaskRemoteMgmtError.MSG_TIDY}")
else:
LOG.debug(
"Removing authentication keys and contact file "
Expand Down Expand Up @@ -317,21 +316,18 @@ def construct_remote_tidy_ssh_cmd(
if item.proc.returncode == 255:
timeout = time() + 10.0
self.bad_hosts.add(item.host)
LOG.warning(
f"Failed to tidy remote platform: "
f"'{item.platform['name']}' using host '{item.host}'; "
"trying a different host"
)
try:
retry_cmd, retry_host = construct_remote_tidy_ssh_cmd(
item.platform
)
except (NoHostsError, PlatformLookupError) as exc:
LOG.warning(
f"remote tidy on {item.platform['name']}: "
f"{TaskRemoteMgmtError.MSG_TIDY}\n{exc}"
)
LOG.warning(f"{exc}; {TaskRemoteMgmtError.MSG_TIDY}")
else:
LOG.debug(
"Failed to tidy remote platform "
f"'{item.platform['name']}' using host '{item.host}'; "
f"trying new host '{retry_host}'"
)
queue.append(
item._replace(
host=retry_host,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ __HERE__

# remote tidy fails definition order time round"
named_grep_ok "definition order remote tidy fails" \
"Tried to tidy remote platform: 'mixedhostplatform' using host 'unreachable_host' but failed; trying a different host" \
"Failed to tidy remote platform 'mixedhostplatform' using host 'unreachable_host'; trying new host '${CYLC_TEST_HOST}'" \
"${WORKFLOW_RUN_DIR}/log/workflow/log"

purge "${WORKFLOW_NAME}" "mixedhostplatform"
# purge "${WORKFLOW_NAME}" "mixedhostplatform"
exit 0

0 comments on commit bfe5e8f

Please sign in to comment.