Skip to content

Conversation

wfchandler
Copy link
Contributor

Currently the mtime for log files captured in support bundles is always set as the default value of 1980-01-01T00:00. To more easily sort files by time, it would be convenient to capture their actual mtimes in the bundle zip.

Attempt to get the mtime for logs captured by sled-diagnostics, falling back on the default if this fails, and copy the mtime into the final bundle zip in nexus.

@wfchandler wfchandler force-pushed the wc/bundle-mtime branch 4 times, most recently from 44b389f to c202a87 Compare October 15, 2025 19:19
Currently the mtime for log files captured in support bundles is always
set as the default value of 1980-01-01T00:00. To more easily sort files
by time, it would be convenient to capture their actual mtimes in the
bundle zip.

Attempt to get the mtime for logs captured by `sled-diagnostics`,
falling back on the default if this fails, and copy the mtime into the
final bundle zip in nexus.
@wfchandler wfchandler marked this pull request as ready for review October 16, 2025 01:04
@papertigers
Copy link
Contributor

I think this is good information to pass along in the zip file, however I believe we already have access to the mtime from oxlog, if you look at get_zone_logs_inner() we are grabbing <LogFIle>.path instead of using the LogFile type given to us directly from oxlog. It's probably better if we thread that through everywhere since we already paid for the stat call already and have the data. I realize that's pretty much a complete rework of this PR but is more efficient, thoughts?

@wfchandler
Copy link
Contributor Author

I think this is good information to pass along in the zip file, however I believe we already have access to the mtime from oxlog, if you look at get_zone_logs_inner() we are grabbing <LogFIle>.path instead of using the LogFile type given to us directly from oxlog. It's probably better if we thread that through everywhere since we already paid for the stat call already and have the data. I realize that's pretty much a complete rework of this PR but is more efficient, thoughts?

Great point, I've updated to use the cached mtime when available.

Oxlog is already collecting the file mtime for us when it find the logs.
Avoid `stat`ing the files a second time and pass the cached time to the
zip archive.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants