Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CBG-4322 use unique output files #7352

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

CBG-4322 use unique output files #7352

wants to merge 1 commit into from

Conversation

torcolvin
Copy link
Collaborator

CBG-4322 use unique output files

Written on top of #7351 code

In the case that there is a file with the same contents in multiple places, this fixes the idea that this writes this to the same file.

e.g. log_file_path in config.json is /var/log/sync_gateway

There is /var/log/sync_gateway/sg_info.log and /home/sync_gateway/logs/sg_info.log

The two will be concatenated together before this fix. There's another fix in #7351 which canonicalizes the paths with path.Pathlib.resolve before uploading.

I've considered whether to add some log messages to say where the files are picked up from, so we'd know why we got a duplicate. log is only written to stderr, but we could write tee to a file like sgcollect_info-output.log so we'd have an idea why things might go wrong.

New tests were written.

In the case where an output file with the same name is detected, do not
write it again to the same file
Copy link
Member

@bbrks bbrks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code reivew is fine - I see nothing jumping out at me.

I'd like to spent an hour or so testing it though before merging similar to #7351

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