-
Notifications
You must be signed in to change notification settings - Fork 380
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
feat(snapshots): added support for reading from named pipes #3034
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3034 +/- ##
==========================================
- Coverage 75.52% 75.52% -0.01%
==========================================
Files 460 460
Lines 36641 36646 +5
==========================================
+ Hits 27674 27677 +3
Misses 7050 7050
- Partials 1917 1919 +2
☔ View full report in Codecov by Sentry. |
fs/localfs/local_fs.go
Outdated
@@ -356,6 +356,7 @@ func Directory(path string) (fs.Directory, error) { | |||
func entryFromDirEntry(fi os.FileInfo, prefix string) fs.Entry { | |||
isplaceholder := strings.HasSuffix(fi.Name(), ShallowEntrySuffix) | |||
maskedmode := fi.Mode() & os.ModeType | |||
readNamedEnv := os.Getenv("KOPIA_SNAPSHOT_NAMED_PIPES") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is called in a tight loop, reading from environment has non-trivial cost and should be avoided in such a place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing :)
I‘ll update the PR to cache the value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved the variable outside the function. This should fix the performance issues.
Hi,
this is just 2 lines, which makes kopia read named pipes like files. I'd like to use that for streaming multiple database dumps in the same snapshot, so the backup is atomic.