Constant File Cache Conflict for Symbolic Link

Answered

I have a TODO file which I access from multiple PCs where I develop. Because it's not meant to be placed in VCS I made it a symbolic link.

Now every few times I try to save, I get File Cache Conflict, as if the file changed outside of IDEA, but it's not. The difference view shows just what I last typed. If I make lots of small changes and save; like repeating {<Space>,<Ctrl>+S} I get it every so often. It only appears when trying to save, never when alt-tabbing away or to IDEA.

I first thought the clocks of both PCs might be out of synch in a way that the file, when saved, sometimes has a date in the future. This is not the case:

This command repeats, as fast as possible, showing local time and file time, to nanoseconds precision. I cut the part where the file date changed because of a save action in IDEA and see that the local time is actually later than the server time:

> while true; do date -Ins; ls --full-time /mnt/PROJECTS/2017/17003/documents/TODO; done

> 2019-03-11T13:28:28,651490791+01:00
> -rwxrw-r--+ 1 mark mark 6701 2019-03-11 13:28:28.644555700 +0100 /mnt/PROJECTS/2017/17003/documents/TODO

Note: I have the "safe write" option enabled and want to keep it that way.

How can I prevent this message from popping up?

12 comments
Comment actions Permalink

Does the same issue occur with the file watcher disabled by adding -Didea.filewatcher.disabled=true in Help | Edit Custom VM Options and restarting IntelliJ IDEA?

Do you share the file via WSL or is it some network share?

Does it work via SMB or some other protocol? What is the target file system this file resides on?

Another thing you can try is to add idea.io.use.nio2=true in Help | Edit Custom Properties (restart is required).

0
Comment actions Permalink

Yes, it still happens when either or both of these flags are added. This is not WSL, I'm on native Ubuntu. The share is SMB, also running on Linux but for the reason to make it also available to Windows PCs.

The mount (/etc/fstab) is like this:

//192.168.178.11/projects /mnt/PROJECTS cifs username=mark,password=<password>,rw,sec=ntlm,vers=1.0 0 0

For reference, these are my VM options now:

-Xms128m
-Xmx750m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Dawt.useSystemAAFontSettings=lcd
-Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine
-Duser.name=Mark Jeronimus
-Dsun.java2d.opengl=false

-Didea.filewatcher.disabled=true

0
Comment actions Permalink

This report looks similar: https://youtrack.jetbrains.com/issue/IDEA-55439

Please file new issue at https://youtrack.jetbrains.com/issues/IDEA with your setup description and idea.log attached after adding these debug log categories in Help | Debug Log Settings:

#com.intellij.openapi.vfs
com.intellij.openapi.vfs

and reproducing the issue. Thanks.

0
Comment actions Permalink

Please add

idea.io.coarse.ts=true

in Help | Edit Custom Properties. Restart the IDE and see if it helps.

0
Comment actions Permalink

Still no change. I sort of expected it to be a workaround, making the popups less probable, but the popup appears just as often.

0
Comment actions Permalink

Excerpt from the log (with all the above options enabled):

```
2019-05-27 11:38:22,281 [ 325488] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 321 ms
2019-05-27 11:38:22,441 [ 325648] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 57 ms
2019-05-27 11:38:22,984 [ 326191] INFO - rationStore.ComponentStoreImpl - Saving appFileTypeManager took 12 ms, MissingInActions took 41 ms
2019-05-27 11:38:23,101 [ 326308] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 239 ms
2019-05-27 11:38:23,158 [ 326365] INFO - mpl.MemoryDiskConflictResolver - reload TODO from disk?
2019-05-27 11:38:23,158 [ 326365] INFO - mpl.MemoryDiskConflictResolver - documentStamp:1758
2019-05-27 11:38:23,158 [ 326365] INFO - mpl.MemoryDiskConflictResolver - oldFileStamp:1754
2019-05-27 11:38:23,935 [ 327142] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 785 ms
2019-05-27 11:38:23,968 [ 327175] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 29 ms
2019-05-27 11:38:24,044 [ 327251] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 27 ms
2019-05-27 11:38:24,691 [ 327898] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 232 ms
2019-05-27 11:38:24,756 [ 327963] INFO - mpl.MemoryDiskConflictResolver - reload TODO from disk?
2019-05-27 11:38:24,757 [ 327964] INFO - mpl.MemoryDiskConflictResolver - documentStamp:1773
2019-05-27 11:38:24,757 [ 327964] INFO - mpl.MemoryDiskConflictResolver - oldFileStamp:1769
2019-05-27 11:38:25,365 [ 328572] WARN - rationStore.ComponentStoreImpl - save call is ignored because another save in progress
java.lang.Throwable
at com.intellij.configurationStore.ComponentStoreWithExtraComponents.save$suspendImpl(ComponentStoreWithExtraComponents.kt:29)
at com.intellij.configurationStore.ComponentStoreWithExtraComponents.save(ComponentStoreWithExtraComponents.kt)
at com.intellij.configurationStore.StoreUtilKt.saveSettings(storeUtil.kt:93)
at com.intellij.configurationStore.StoreUtilKt.saveProjectsAndApp(storeUtil.kt:158)
at com.intellij.configurationStore.StoreUtilKt$saveDocumentsAndProjectsAndApp$2$2.invokeSuspend(storeUtil.kt:186)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:236)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2019-05-27 11:38:25,420 [ 328627] WARN - rationStore.ComponentStoreImpl - save call is ignored because another save in progress
java.lang.Throwable
at com.intellij.configurationStore.ComponentStoreWithExtraComponents.save$suspendImpl(ComponentStoreWithExtraComponents.kt:29)
at com.intellij.configurationStore.ComponentStoreWithExtraComponents.save(ComponentStoreWithExtraComponents.kt)
at com.intellij.configurationStore.StoreUtilKt.saveSettings(storeUtil.kt:93)
at com.intellij.configurationStore.StoreUtilKt.saveProjectsAndApp(storeUtil.kt:163)
at com.intellij.configurationStore.StoreUtilKt$saveProjectsAndApp$1.invokeSuspend(storeUtil.kt)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:32)
at kotlinx.coroutines.DispatchedTask.run(Dispatched.kt:236)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2019-05-27 11:38:25,421 [ 328628] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 667 ms
2019-05-27 11:38:25,491 [ 328698] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 126 ms
2019-05-27 11:38:25,524 [ 328731] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 71 ms
2019-05-27 11:38:25,749 [ 328956] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 89 ms
2019-05-27 11:38:25,978 [ 329185] INFO - mpl.MemoryDiskConflictResolver - reload TODO from disk?
2019-05-27 11:38:25,978 [ 329185] INFO - mpl.MemoryDiskConflictResolver - documentStamp:1789
2019-05-27 11:38:25,978 [ 329185] INFO - mpl.MemoryDiskConflictResolver - oldFileStamp:1783
```

0
Comment actions Permalink

Unfortunately, we don't have any other ideas at this point, sorry.

0
Comment actions Permalink

I just ran into similar issues with PyCharm that were introduced by an improperly configured file watcher.

(Tools -> File Watchers)

If you have those problems try to disable your watchers to see if that helps.

Note:

The issues I ran into were with regular files, not symlinks.

0
Comment actions Permalink

I can't find a 'File Watchers' in menu 'Tools'. Are you using IDEA or another IDE?

0
Comment actions Permalink

Mark Jeronimus, sorry - this is in PyCharm - which has the exact same issue. (I thought this issue was about PyCharm).

0
Comment actions Permalink

I haven't had the issue for a few months now. I checked the simlink, it's fine. I checked the clocks of both PCs. The server is now 8ms ahead of my PC instead of 5ms so I don't think that makes any difference. I removed the VM options and still can't reproduce it.

0

Please sign in to leave a comment.