sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

Refresh showtech dump file modify timestamp before cleanup call

Open anamehra opened this issue 1 year ago • 1 comments

Signed-off-by: Anand Mehra [email protected]

Fixes: https://github.com/sonic-net/sonic-buildimage/issues/20693

What I did

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

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

anamehra avatar Nov 04 '24 20:11 anamehra

Hi @abdosi , please review or add reviewers. Thanks

anamehra avatar Nov 04 '24 20:11 anamehra

Hi @qiluo-msft , please help with this PR review. Thanks

anamehra avatar Nov 08 '24 18:11 anamehra

@yejianquan for cherry-pick to 202405

abdosi avatar Nov 13 '24 18:11 abdosi

Cherry-pick PR to 202405: https://github.com/sonic-net/sonic-utilities/pull/3614

mssonicbld avatar Nov 14 '24 06:11 mssonicbld