Skip to content
New issue

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

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

Already on GitHub? # to your account

CBG-4322 use unique output files #7352

Open
wants to merge 2 commits into
base: CBG-4371
Choose a base branch
from
Open

CBG-4322 use unique output files #7352

wants to merge 2 commits 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant