You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like on Windows the filestream input calls OpenFile, GetFileInformationByHandle, and CloseFiletwice for each log line read (six syscalls per line read). It would be good to get a second opinion on this. The code path is through:
@andrewkroh thanks for discovering this, it comes to me as a surprise that os.SameFile opens and closes files on Windows, furthermore, it actually acquires a file system lock doing so.
I believe our code populates the IDs elsewhere, so we should be able to get rid of this os.SameFile call in setFileSystemMetadata by storing the values once they are set for the first time.
It looks like on Windows the filestream input calls
OpenFile
,GetFileInformationByHandle
, andCloseFile
twice for each log line read (six syscalls per line read). It would be good to get a second opinion on this. The code path is through:beats/libbeat/reader/readfile/metafields.go
Line 64 in e4d287f
beats/libbeat/common/file/file_windows.go
Lines 44 to 48 in 8ff6894
https://pkg.go.dev/os#SameFile
https://cs.opensource.google/go/go/+/master:src/os/types_windows.go;l=243-249?q=loadFileId&ss=go%2Fgo
Relates: #36065
The text was updated successfully, but these errors were encountered: