Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352507 - random "resource out of sync"
Summary: random "resource out of sync"
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Search (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Search-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-19 16:41 EDT by Dave Dyer CLA
Modified: 2011-07-20 03:22 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Dyer CLA 2011-07-19 16:41:27 EDT
Build Identifier: Build id: 20100917-0705


These errors seem to occur randomly, and certainly occur on files that
have not been modified.   Aside from the question of why the resources
are thought to be out of sync, what is the point of this message???  As
far as I can tell, there is no possible resolution other than to reopen
the file in question.  There's no way to acually use the out-of-date resource,
so it should just be discarded, preferably silently.


Problems encountered during text search.
File 'boardspace/quinamid/QuinamidPlay.java' has been skipped, problem while reading: ('Resource is out of sync with the file system: '/boardspace/quinamid/QuinamidPlay.java'.').
Resource is out of sync with the file system: '/boardspace/quinamid/QuinamidPlay.java'.
File 'boardspace/online/common/OnlineConstants.java' has been skipped, problem while reading: ('Resource is out of sync with the file system: '/boardspace/online/common/OnlineConstants.java'.').
Resource is out of sync with the file system: '/boardspace/online/common/OnlineConstants.java'.

Reproducible: Sometimes

Steps to Reproduce:
1. random occurrence when using the IDE normally, but usually noticed
when using file search, which has to open all the files.
Comment 1 Dani Megert CLA 2011-07-20 01:23:21 EDT
>These errors seem to occur randomly, and certainly occur on files that
>have not been modified.
Definitely not true. Something/someone changed those files. Maybe they were for example regenerated.

> Aside from the question of why the resources
> are thought to be out of sync, what is the point of this message???
The point is to inform you that someone/something changed those files. Given that you obviously don't even know that this happens, it looks like a pretty useful message to me ;-).

If you really don't care that your files get changed behind your back then you can select 'Refresh on access' on the General > Workspace preference page (3.7 or newer).
Comment 2 Dave Dyer CLA 2011-07-20 01:36:47 EDT
The two files cited in this report "quinamidplay.java"
and "onlineconstants.java"

-rw-rw-rw-   1 user     group        9042 Jul 09 16:07 quinamidplay.java
-rw-rw-rw-   1 user     group       14371 Jul 09 16:07 OnlineConstants.java

I'm pretty sure I've done searches within the last 10 days that
should have noticed an out of date resource, and anyway, the last
entity to modify those files was eclipse itself.  It is suspicious
that they have exatly the same creation date/time.

Anyway, I assure you that from all appearances, the occurence of this 
bug is random.  A few randomly selected source files are announced to
be out of date, when they have not been recently modified.

The alternative explantation, that the resource is corrupted, seems
credible to me.
Comment 3 Dani Megert CLA 2011-07-20 01:51:11 EDT
> Anyway, I assure you that from all appearances, the occurence of this 
> bug is random.  A few randomly selected source files are announced to
> be out of date, when they have not been recently modified.
> 
> The alternative explantation, that the resource is corrupted, seems
> credible to me.
I don't think they are corrupted as the message is not tied to file contents. It only compares the timestamps. Maybe the resource was only touched. Maybe they were restored from a backup? Maybe some program wrongly touches them.
Comment 4 Dave Dyer CLA 2011-07-20 03:06:36 EDT
I am completely sure that no other program (than eclipse) has modified
these files recently.   They have not been restored from backup.  

It is conceivable that eclipse itself was used to modify them (as in
an editing error that was later undone by eclipse.  Maybe some scenario
like accidental modifiction/autosave/c-z to undo the modification.  Some
data files share the same date/time with these two source files, which
indicates eclipse was in active use at that precise time, but there's no
way any other program could be responsible for the modification dates.

While these two files are examples, they are not unique.  These random
"stale resource" errors happen regularly.   This workspace contains 
hundreds of source files, none of which are ever modified by any
other program.
Comment 5 Dani Megert CLA 2011-07-20 03:10:54 EDT
> While these two files are examples, they are not unique.  These random
> "stale resource" errors happen regularly.   This workspace contains 
> hundreds of source files, none of which are ever modified by any
> other program.
If you find steps to reproduce it then please file a bug for that. This wouldn't be search related but a general issue in an action bringing files into out-of-sync state.
Comment 6 Dave Dyer CLA 2011-07-20 03:17:29 EDT
In any case, other than being pedantic and wanting it's bookeeping to be
correct, what is the point of this error message?

Eclipse doesn't own these files and has no reasonable expectation that
they should be untouched by other programs.  It should be considered "normal"
that files occasionally are seen to be newer than eclipse expected.  I should
not have to do any special "mother may i" to get eclipse to start using the
newer files.   The only effect of this message is to force me to stop work,
force eclipse into accepting the new files, and then resume my search.

These are apparently not files for which eclipse has a copy of the actual
contents, so there is no choice of "use the new or old version" available.
Comment 7 Dave Dyer CLA 2011-07-20 03:19:23 EDT
I think it is a general issue, not search specific.  Search is only the 
culprit here because it's the operation that touches everything.  I see
the same problem occasionally when doing other things, such as refactoring.
Comment 8 Dani Megert CLA 2011-07-20 03:22:41 EDT
(In reply to comment #6)
> In any case, other than being pedantic and wanting it's bookeeping to be
> correct, what is the point of this error message?

I already said explained that. Anyway, for those who see this as pedantic, we have the option to auto-refresh as also already explained.