klogg icon indicating copy to clipboard operation
klogg copied to clipboard

Follow file stops from time to time

Open kindacute opened this issue 3 years ago • 8 comments

From time to time following of file stops and then starts by itself. So in 1 minute it can happen about 2-3 times when following file stops. I am using klogg almost in default configuration except highlightings (Attaching them to issue).

  1. Start reading file
  2. Wait 2-3 minutes

AR: Following is stopped from time to time ER: Following doesn't stop and continue to read file

Klogg version is: 22.04.0.1216 QT version: 5.15.2 Macos Monterey 12.3.1

Highlights: listofhighlights.conf.zip Generated crash file:72d2737d-51cc-4309-a9f4-68293b6f71e9.dmp.zip

kindacute avatar Apr 16 '22 15:04 kindacute

I have similar problem that couldn't monitor file at real time .You could try to enable polling for changes in options. It works ok now.

wangjianpeng avatar Apr 16 '22 23:04 wangjianpeng

@kindacute looks like enabling polling for changes in klogg options could help in this case. Klogg uses efsw library for file changes monitoring. It could be that notifications are delayed until changes go from fs cache do disk. I don't have any mac hardware, so it is hard to test properly.

variar avatar Apr 17 '22 13:04 variar

@wangjianpeng , @variar thank you guys, I will try polling tomorrow and will let you know if it helps

kindacute avatar Apr 17 '22 13:04 kindacute

Works good with polling.

kindacute avatar Apr 18 '22 11:04 kindacute

Good to know. Efsw has two file monitoring backends for macOS. I'll check which one is better, or maybe add an option to choose a backend.

variar avatar Apr 19 '22 22:04 variar

Looks like polling is not good too, what is minimal value for it? I tried 200 ms and 100 ms, but klogg updates file with much greater random interval. Especially it is noticeable when lot of data writes into file

kindacute avatar Apr 20 '22 10:04 kindacute

That could also be related to some file system level caching. I usually leave polling interval at 2000ms. Making it lower than 500ms will just cause unnecessary load. I'm still looking for reliable cross-platform library for file changes notifications. But with more reports like this it looks like I'll have to dig into platform-specific libraries or tail source code.

variar avatar Apr 20 '22 11:04 variar

Klogg has some throttling for file system notifications as sometimes in big file trees there are so many events that it hangs (see #286). Throttling interval was set to 500ms. Reducing it to 250ms should make klogg more responsive.

variar avatar May 20 '22 20:05 variar