zlatinb / muwire

MuWire file sharing client for I2P
GNU General Public License v3.0
191 stars 27 forks source link

Shared folder OS monitoring seemingly not disabled in MuWire-0.8.13-beta3.AppImage ? #149

Closed slrslr closed 2 years ago

slrslr commented 2 years ago

Hello, I have downloaded MuWire-0.8.13-beta3.AppImage Muwire crashed because other app was writing to shared and monitored directory. #148 So i wanted to disable the folder monitoring by the OS by left clicking one of the shared folder in Muwire library tab, then right click it (unable to just right click, but this was answered already why) now i click to go to settings of that shared folder and un-tick the OS monitoring option, yet after saving and returning to folder settings again i see it remain ticked, here is the video

UPDATE: after app crash due to linked issue and start again, I see that the folder monitoring is disabled/un-ticked in folder properties. If MuWire can be made to reflect change immediately it may prevent confusion. If not, please close this.

zlatinb commented 2 years ago

Changes to the configuration get processed on a background thread which may have been busy at the time (I can't see from the video if muwire was hashing files or something like that). If you wait until it's not doing anything then the changes should be applied immediately. Please give it a try again.

slrslr commented 2 years ago

Library loading finished like one hour ago. No download, 2 upload threads. No search. I am sharing many thousand of files though in the library. Yet disabling shared folder OS monitoring and returning back to configuration window i see it is still ticked/enabled. (like shown on the video linked earlier). But as mentioned app crash and start properly marked folder/s as un-ticked/not monitored. This is not a big problem maybe. Maybe hard to figure out why it is not updated immediately.

zlatinb commented 2 years ago

Maybe there's a bug that got introduced, I need to understand exactly what is going on. I'll try some things locally and may ask you to turn on logging if you can reproduce this easily.

zlatinb commented 2 years ago

I couldn't reproduce this, so I'm not sure what is happening. The latest CI build contains some precautions against this so please give it a try.

slrslr commented 2 years ago

Git cloned now (Updating ***..4ebdd147) and built - Gradle. I have seen that the tickbox (automatic folder monitoring by OS) in the shared folder properties was updated within several minutes after change (what i mean by "updated" and reflect change? It is shown in the video already linked in 1st post of this issue). This happened even the Library was still loading. Other shared folder change was reflected after like 15 minutes (also during Library loading) - the folder has just 272 files in it (recursively).

zlatinb commented 2 years ago

While the library is loading I would expect this to take some time but still several minutes sounds too long. Please update to the latest from git and do the following:

  1. Save this text as a file called logging.properties
  2. add the following two lines at the end of that file:
    com.muwire.core.files.FileManager.level = FINE
    com.muwire.core.files.directories.WatchedDirectoryManager.level = FINE

Then restart MuWire. A file called MuWire.log will appear in the current working directory (where you saved logging.properties). Change the configuration of a directory of your choosing and wait until the configuration gets saved, i.e. it shows the correct configuration when you try to configure the same directory again. Then look for the name of the directory in the log file and copy-paste those lines in this issue.

You should expect to see something like:

<timestamp> FINE <some other stuff> WatchedDirectoryConfiguration enrichment "<directory path>" <a number> <another number>
...
<timestamp> FINE <some other stuff> WatchedDirectoryConfguration processing <a number>"
...
<timestamp> FINE <some other stuff> persist <directory path>
...
<timestamp> FINE <some other stuff> doPersist <directory path>

From these timestamps I will be able to tell where the time is going.

zlatinb commented 2 years ago

Hi again, with the latest commit 6114389 MuWire should load the shared files much faster which will hopefully help with the delays in the configuration updates. The search index is now updated in a background thread which means that if you try to search for a file you're sharing too soon after startup you may not see a result. Please let me know if that helps.

slrslr commented 2 years ago

Sounds nice. I git cloned, (Updating 4ebdd147..61143890) built (Gradle). Ran it. I can see that now the configuration is indeed as You say updated immediately, (Enabling/disabling shared folder monitoring by OS tickbox is preserved on next folder config. window opening) solving this issue apparently...

I have also verified that enabling shared folder OS monitoring indeed works and cause new file added by OS immediately appear in Library and after disabling monitoring. It not add new file. So it works and this issue can be closed from my point of view.

load the shared files much faster

Speed of loading is roughly 300 files per second in my case, i see i have enabled config. option to Slow down loading of Library files during stat. I think You this option because else it was lagging UI or CPU overload, but that is another topic.

zlatinb commented 2 years ago

Good to hear. Yes the option to slow down loading of shared files on startup is there to prevent UI overload and it throttles to up to 500 files/second. You can disable it if you wish to experiment.

Closing this issue now.