Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
EOS-23898: motr-freespace-monitor - Add a delay between retry before …
Browse files Browse the repository at this point in the history
…failure

Problem : Hare may take sometime to retrieve capcacity info during
startup, if the capacity_info is not recieved, free space monitor would
timeout with error.
Solution: Add delay between retry, After 10 retries, if it still fails
than return failure.

Signed-off-by: Yeshpal Jain <yeshpal.jain@seagate.com>
  • Loading branch information
yeshpal-jain-seagate committed Aug 24, 2021
1 parent 2159719 commit eda1370
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ def execute_command(command):
console_output = json.loads(process.stdout.decode('utf-8'))
capacity_info = console_output.get('filesystem',{}).get('stats',{})
if not capacity_info:
time.sleep(iem_alert_check_interval)
continue
return capacity_info

msg = " Returned with error " + str(rc)
log.error(f"Failed to process command after {iem_max_retry} retry '{command}':{msg}")
log.error(f"out: {json.loads(process.stdout.decode('utf-8')).get('filesystem',{}).get('stats',{})}")
print(process.stderr.decode('utf-8'))
sys.exit(FS_SYSTEMD_FAILED)

Expand Down

0 comments on commit eda1370

Please sign in to comment.