

I don't know how you would make that happen from the FileSystemWatcher side of things. Would it make sense to make "auto-flushing" a thing If possible, from a performance perspective, it would be good to isolate the files you don't care about from the ones you do, even if you can manage to capture everything by increasing the buffer size. I could be missing something, but first guess is it seems like you might be overwhelming the watcher.

Outside of the above if you can simplify the repro any further it would help. The buffer size can be increased, it defaults to 8K, which can be eaten in a hurry with lots of events with long file names. You can add an Error handler to see if this is happening- it should fire as described in the documentation. Given that the file name filtering is being done by FileSystemWatcher, this might be happening.
#Filewatcher notifyfilters windows#
If there is more than will fit into the buffer Windows will toss all events. The other thing that can happen is that if a lot of changes are happening you will lose change notifications. other blocks in the file so I can't say for sure that observing contents will reflect attribute updates. I'm also not sure what the exact behavior is for updates to the attributes vs. Wouldn't that suggest that the filesystem is flushing, at least periodically

Update: I tested this on Windows, too, and the same thing holds true there. Is it possible that PostgreSQL is writing to these logs in a way that the underlying implementation of FileSystemWatcher is unable to detect? Sprintf "configuring watcher with path: ' %s' and format: ' %s' " path formatįailwithf "data directory does not exist: %s " path Sprintf " %s deleted ( %O) " fsea.FullPath fsea.ChangeType Let handlePathDeleted ( fsea : FileSystemEventArgs ) = Sprintf " %s renamed to %s ( %O) " rea.OldFullPath rea.FullPath rea.ChangeType Let handlePathRenamed ( rea : RenamedEventArgs ) = Sprintf " %s created: %O " fsea.FullPath fsea.ChangeType Let handlePathCreated ( fsea : FileSystemEventArgs ) = Sprintf " %s changed: %O " fsea.FullPath fsea.ChangeType Type LogFileWatcher ( logger : ILogger, optionsMonitor : IOptionsMonitor) = inherit BackgroundService () let handleFileChanged ( fsea : FileSystemEventArgs ) = Type LogFileWatcherOptions () = member val DataDir = " " with get ,set
