Skip to main content
Topic: index-data files are written twice on each save (Read 216 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

index-data files are written twice on each save

I originally reported a symptom of this issue back in 1,.4 Beta 17 and then again once 1.4 went final. I finally got fed up with it and did a lot of debugging today and determined the root cause listed in the subject.

It appears that whenever index-data is written by either api->save_index_data (like I think foo_jesus uses) or by closing foobar, all of the index-data files are written, and then immediately rewritten again. As best I can tell, the data is exactly the same for both writes,

In my setup I have my index-data folder stored in dropbox, and then I use a junction to place it in the foobar folder. Whenever index-data is written, they are synced to dropbox for backup and sharing across computers. I've been running this way for 5 years without incident until 1.4 Beta 17. Once Beta 17 came out (it happened between beta 8 and 17) I started getting access denied errors writing to index-data, but a retry usually fixed it. These were intermittent however so I've just lived with it. Today I determined that what's happening is that foobar writes the index-data files, then dropbox notices the changed files and immediately tries to read them to sync changes. If foobar attempts to write the files again while dropbox has them locked, we get the access denied error.

This is a very clear race condition that is heavily dependent on r/w speed of the drive (and possibly other system I/O). I see it almost 1/3 of the time on my external HDD at work, and pretty rarely on my SSD at home. When the access denied error pops up, I can open the index-data folder and see that all files have updated time stamps. Hitting retry (which sometimes fails itself!) will update the time stamps of all files in the folder again.

My assumption is that the save process is being called twice or the retry state is always being called for some reason. I should note that it happens when transacted file system writes are both enabled and disabled. I realize this probably doesn't affect many people, but it'd be great if it could be fixed.

Re: index-data files are written twice on each save

Reply #1
Hey there,

What foobar version were you testing on today? There was a recent 1.4.2 beta 1 that might have addressed it (here and here). Not sure if exactly same issue though.

Re: index-data files are written twice on each save

Reply #2
Thanks for the bug report.
The problem has been confirmed and fixed for the next update.

Re: index-data files are written twice on each save

Reply #3
Version 1.4.2 beta 2 out, this bug should be fixed.

Re: index-data files are written twice on each save

Reply #4
Thanks, Peter. Can confirm the issue is fixed! Service like this is just another reason why fb2k is the greatest software around.

 
SimplePortal 1.0.0 RC1 © 2008-2019