Skip to content

Commit

Permalink
Refresh dump file modify timestamp before cleanup call (sonic-net#3595)
Browse files Browse the repository at this point in the history
During the show techsupport, generate_dump calls techsupport_cleanup with current generated file. The techsupport_cleanup verifies the file path provided for file last modification timestamp and on success only proceeds to cleanup. It expects the file to be modified within last 20 secs. Sometimes when file is big, gzip takes more that 20 sec. Due to this, the last modify timestamp to current time stamp diff is greater than 20 and verify_recent_file_creation fails causing cleanup to fail.

How I did it
touch the tarfile after finishing the gzip to refresh modify timestamp.

How to verify it
run show techsupport
  • Loading branch information
anamehra authored Nov 13, 2024
1 parent 8f3c5ef commit 0e18807
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -2223,6 +2223,9 @@ finalize() {
else
echo "WARNING: gzip operation appears to have failed." >&2
fi
# sometimes gzip takes more than 20 sec to finish, causing file time create validation
# to fail. touching the tarfile created to refresh modify time.
touch ${TARFILE}
fi

# Invoke the TechSupport Cleanup Hook
Expand Down

0 comments on commit 0e18807

Please sign in to comment.