Bug 16280 - [resources] Build 20020515 resource out of sync error
Summary: [resources] Build 20020515 resource out of sync error
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Resources (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows NT
: P2 critical with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-Resources-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 15521 17647 19789 21435 28432 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-17 13:01 EDT by Adalbert Homa CLA
Modified: 2006-04-17 12:45 EDT (History)
9 users (show)

See Also:


Attachments
FileSystemResourceManager.java (27.55 KB, text/plain)
2002-06-18 05:59 EDT, Neil Swingler CLA
no flags Details
Test program that may illustrate the problem (1.29 KB, text/plain)
2002-10-10 10:18 EDT, John Arthorne CLA
no flags Details
Output of the text program (706 bytes, text/plain)
2002-10-10 11:20 EDT, Matthew Shaylor CLA
no flags Details
Result of test program (1.59 KB, text/plain)
2002-10-10 11:33 EDT, Adalbert Homa CLA
no flags Details
A modified library to use the java io for fetching last-modified times. (5.74 KB, text/plain)
2002-10-11 04:41 EDT, Matthew Shaylor CLA
no flags Details
This test program will reproduce the problem (1.46 KB, text/plain)
2002-10-11 10:33 EDT, Neil Swingler CLA
no flags Details
Clearcase over samba workaround (514.10 KB, application/x-zip)
2003-02-10 10:45 EST, Neil Swingler CLA
no flags Details
improved Clearcase over samba workaround (514.15 KB, application/x-zip)
2003-02-12 05:03 EST, Neil Swingler CLA
no flags Details
workaround patch for 2.1rc2 (520.58 KB, application/x-zip)
2003-03-11 04:54 EST, Neil Swingler CLA
no flags Details
patch for 2.1 full release (520.40 KB, application/x-zip)
2003-03-31 03:21 EST, Neil Swingler CLA
no flags Details
patch for 3.0M1 (565.20 KB, application/octet-stream)
2003-06-20 03:45 EDT, Neil Swingler CLA
no flags Details
patch for 3.2 m5 (639.18 KB, application/x-jar)
2006-03-17 09:16 EST, Neil Swingler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adalbert Homa CLA 2002-05-17 13:01:42 EDT
This build is unusable for me. I am working on files that are stored on a
network drive (ClearCase and Samba).
Here is the reproducable behaviour.
I open a file, modify the file then save it.
Without closing the file I make another modification.
When I try to save, Eclipse complains that resource out of sync. 
I refresh the file, Eclipse do no ask me about reloading the file, try to save
again. This time Eclipse is showing me an "Update conflict" error.
I have to copy the content of the file to clipboard, close the file, open the
file again and paste from the clipboard.

This is a bug introduced after M5. M5 has no problem. Integration build 20020510
did not shown me the "Update conflict", instead it asked if I want to reload the
file after the refresh. If I said no, then press save it asked me about overwriting.
Comment 1 Nick Edgar CLA 2002-05-17 16:22:51 EDT
Are you running with ClearCase integrated with Eclipse, or just running 
separately?
Are you making all the changes via Eclipse, or also modifying the files in the 
filesystem?
Are other ClearCase users modifying the same file at the same time?

Note that since M5 the "Update conflict" behaviour has changed to only warn you 
once and offer to reload.  If you say no, it doesn't ask you again.  But you 
should still get it.
Comment 2 Adalbert Homa CLA 2002-05-18 10:53:21 EDT
1. I run ClearCase separately.
2. The changes are only made with Eclipse.
3. No other users are modifying the files.
4. Eclipse does not say anything about file changed. (M5 did say that).


I think this behaviour is somehow linked to SAMBA. I tried to work with a
project on a shared drive (Microsoft NT system) and I had no problem.

Comment 3 Adalbert Homa CLA 2002-05-21 12:06:45 EDT
I checked with the latest build (May 20). The behaviour improved a little bit.
Here is the new behaviour:

1. Open a file with Eclipse.
2. Modify the file and save it.
3. Modify the file again without reloading the file and save. Save will report
resource of sync.
4. I refresh the file (by click on packages view and press F5). Now save works
fine, no messages show up.

I don't know how Eclipse works, but I am thinking that Eclipse mantains the
modified time stamp of the file to know if somebody else changed the file or
not. At the time of save however Eclipse will not read the file system again, he
thinks that is has the timestamp.
Is this a correct ?

This problem occurs only with the ClearCase and Samba combination. I tried it on
SAMBA network drive (without ClearCase) there where no problem.

Comment 4 Adalbert Homa CLA 2002-05-21 12:51:00 EDT
Latest build -----------
The refresh, then save again works only with text files.
Java files still causing problems, files can not be saved at all (it reports
"Update conflict"). I have to save the content in clipboard, close the file,
open it again, then paste from clipboard and save it again.

Comment 5 Adam Kiezun CLA 2002-05-31 13:40:14 EDT
i tried the following setup:
.our pessimistic temp provider (ClearCase-like)
.network drive-based workspace
.eclipse running on w2k

and i saw no problems editing and saving files

we're suspecting that that some timing problems between your samba server and 
your eclipse can be involved.

Comment 6 Kai-Uwe Maetzel CLA 2002-05-31 14:12:15 EDT
All testing in the editor is based on a time stamp computed with the following 
method of FileDocumentProvider:

	protected long computeModificationStamp(IResource resource) {
		long modificationStamp= resource.getModificationStamp();
		
		IPath path= resource.getLocation();
		if (path == null)
			return modificationStamp;
			
		modificationStamp= path.toFile().lastModified();
		return modificationStamp;
	}

Moving to core for consideration whether the decribed setup may cause problems 
in the above code.
Comment 7 John Arthorne CLA 2002-05-31 17:56:02 EDT
The quoted code in FileDocumentProvider doesn't make sense.  
IResource.getModificationStamp() returns a value that is completely unrelated to 
the file's timestamp on disk.  This is just a counter that we increase every 
time the file is somehow touched.  The modification stamp can change without the 
local file timestamp changing, and vice-versa.

However, this value is only used in FileDocumentProvider if 
IResource.getLocation() returns null.  This almost never happens. The only case 
I know of is if the entire project does not exist in the workspace.  The 
filesystem is not consulted by this method so I don't see how the Samba setup 
could influence this.

The only remaining question for that code snippet is the granularity and 
accuracy of java.io.File.lastModified() when running with that Samba/ClearCase 
configuration.  Even on a local filesystem, the granularity lastModified is in 
the 1-2 second range, which isn't sufficient for reliably detecting changes.
Comment 8 Kai-Uwe Maetzel CLA 2002-06-01 03:10:18 EDT
If the code does not make sense, how has the code to look like to make sense?
Comment 9 John Arthorne CLA 2002-06-03 15:18:06 EDT
*** Bug 15521 has been marked as a duplicate of this bug. ***
Comment 10 John Arthorne CLA 2002-06-03 15:37:08 EDT
Ideally, you should avoid all file timestamp calculations, and instead use 
IResource.isSynchronized() on the file.  That leaves the calculation to core.  
We use a native method to calculate the last modified time, which may have a 
finer granularity than the java.io call.  However, I really don't know if this 
code in FileDocumentProvider is the culprit in this particular case.
Comment 11 Adalbert Homa CLA 2002-06-03 16:41:17 EDT
I tried to debug this problem. I could not. When I run it with the debugger
everything is working fine. I think Clearcase updates the timestamp with a delay.

If I open the same file in another editor (or Eclipse) and one of them change
it, Eclipse has no problem seeing that somebody else changed it and offer me a
reload. But I got an error when I try to save it more than once in the same
Eclipse. 

I found rare cases when the out of sync error does not show up. I guess
Clearcase was fast enough than.

Comment 12 DJ Houghton CLA 2002-06-05 12:57:38 EDT
Kai, does IResource.isSynchronized() provide you with the information that you 
need?
Comment 13 John Arthorne CLA 2002-06-07 11:27:50 EDT
See also potentially related bug 17647.
Comment 14 Neil Swingler CLA 2002-06-14 09:13:43 EDT
Well bug 17647 seems to be fixed for me since F2. This "Resource is out of sync"
error is a major problem for my clearcase/samba installation. One thing that
would alleviate the pain would be to allow me to force an overwrite of the
"out of sync" resource when I make a save.

Comment 15 Neil Swingler CLA 2002-06-18 05:59:30 EDT
Created attachment 1473 [details]
FileSystemResourceManager.java
Comment 16 Neil Swingler CLA 2002-06-18 07:14:50 EDT
In my case it isn't a delay in setting the timestamp. Something
is actually changing the timestamp sometime after the save
by one second.

I have created a workaround (see previous attachment) to do the
timestamp comparison approximately rather than exactly.

It produces the following log entries to demonstrate the
1 second difference

!ENTRY org.eclipse.core.resources 2 0 Jun 18, 2002 13:31:34.413
!MESSAGE areNearlyTheSameLastModifiedTimes: 1024399876000, 1024399877000
!ENTRY org.eclipse.core.resources 2 0 Jun 18, 2002 13:31:49.524
!MESSAGE areNearlyTheSameLastModifiedTimes: 1024399900000, 1024399901000
Comment 17 DJ Houghton CLA 2002-06-18 09:21:16 EDT
Thanks for the input but I don't think that the changes give us exactly what 
we are looking for in the majority of cases.

The FileSystemResourceManager.write method looks something like this:

if the timestamp in memory is the same as on disk then
  write the file contents
else
  someone has changed the file outside of Eclispe
  so throw an out of sync exception
endif

Unfortuanatly the changes which you have made to the code would do not 
tolerate changes made on the file system that occur within 2 seconds. This 
means if an external tool is making changes to the underlying files, then 
there is greater potential for these changes to be over-written and lost.
Comment 18 Neil Swingler CLA 2002-06-18 09:46:40 EDT
I agree it's not a solution. But do you appreciate how unuseable Eclipse
is with this problem? Every other save fails.

What about the possibility that an external application changes the
file within the same second. The timestamp will not change with only
1 second accuracy. How do you want to cope with that? 
Comment 19 DJ Houghton CLA 2002-06-18 10:09:28 EDT
Timestamp granularity is exactly one of the reasons that we use our core 
library to retrieve the timestamps of the file on disk. 

In our investigation we discovered that (depending on what VM you are running) 
java.io.File.lastModified() can return anywhere from milli-second accuracy to 
timestamp granularity of 2 seconds.

Comment 20 Adalbert Homa CLA 2002-06-18 10:21:41 EDT
If there are problem with the java.io.File.lastModified() based on different
JVM, maybe we should not use java IO but native call.
Another choice could be to parametrize the granularity of the last modified time
stamp. Some people system will be working correctly, other people system can
work with a 2-3 seconds granularity.

Is last modified time stamp is present all file systems ?

M5 did not had this problem. It appeared only in the integration builds after
M5. Can somebody tell us what changed ?
Comment 21 Neil Swingler CLA 2002-06-18 10:36:12 EDT
Well my win NT installation should be using the native library.
My CoreFileSystemLibrary has not been modified from F3.
As you can see in the log above the timestamp has 1 second granularity.
Comment 22 Neil Swingler CLA 2002-06-19 04:31:15 EDT
How about using a checksum as a secondary check when the timestamps are close
but not equals?
Comment 23 Neil Swingler CLA 2002-06-19 09:14:33 EDT
Some more info:

I'm using NT, Clearcase, Samba and Eclipse F3.
Samba is configured with a timestamp granularity of 2 seconds (to
support Visual Studio users).

I'm not sure why we see odd timestamps at all. I think it must be something
to do with the interaction of clearcase.
Comment 24 Neil Swingler CLA 2002-07-03 06:03:22 EDT
Just tried Rational's Clearcase plugin (2.0.18) with release 2.0.
Problem still exists.
Comment 25 Peter Hack CLA 2002-07-31 17:51:10 EDT
Which version(s) of Samba exhibited this behavior?  I believe this problem was 
addressed in Samba 2.2.1.  See item 17 in the "Changes in 2.2.1" section of:

http://us1.samba.org/samba/whatsnew/samba-2.2.5.html
Comment 26 Neil Swingler CLA 2002-08-02 03:54:24 EDT
We are using 2.2.3
Comment 27 Neil Swingler CLA 2002-09-27 10:12:24 EDT
Summary of investigations so far:

I have hacked 2.0 and now 2.01 to make the file synchronisation check
treat timestamps 1 second appart as being the same.

This cures this problem and that reported in bug 17647.

The bug is actually in clearcase (producing inconsistent timestamps) but
eclipse is rather severe in not allowing the user to overwrite the "out
of synch" file.

This is my current understanding of the clearcase dynamic view timestamp bug:

The clearcase NT client cannot return a consistent timestamp for a given file
in view storage (not vob storage). I was able to minimise the number of times
this happened by ensuring my pc and the view server were timesynched but
it still happens from time to time. Why the client time is involved is beyond
me.

Communication with another eclipse/clearcase sufferer elicited that Rational
had told him that it was necessary to have Clearcase 5.00 patch 7 to have
eclipse compatibility. We are on patch 3 and our admins won't upgrade at the
moment. Maybe the patch fixes these timestamp problems. Can someone else
confirm?

So there are 2 workarounds:
1) use my hack
2) use snapshot views
Comment 28 DJ Houghton CLA 2002-09-27 11:08:17 EDT
*** Bug 19789 has been marked as a duplicate of this bug. ***
Comment 29 DJ Houghton CLA 2002-09-27 15:01:02 EDT
*** Bug 21435 has been marked as a duplicate of this bug. ***
Comment 30 John Arthorne CLA 2002-10-10 10:11:05 EDT
*** Bug 17647 has been marked as a duplicate of this bug. ***
Comment 31 John Arthorne CLA 2002-10-10 10:17:35 EDT
I'm attaching a simple test program that I hope will illustrate the problem.  It
modifies a file, then immediately asks for the timestamp.  Then it delays for
several seconds and asks for the timestamp again.  From the symptoms we're
seeing, it looks like this should give different timestamps before and after the
delay.

For those experiencing this problem, can you please try running the attached
program from a local drive, but pointing it at a file on your samba/NFS drive?
Example:

C:\temp>d:jre\bin\java TimeStampTest Q:\some\path\SomeFile.txt
Comment 32 John Arthorne CLA 2002-10-10 10:18:11 EDT
Created attachment 2151 [details]
Test program that may illustrate the problem
Comment 33 Neil Swingler CLA 2002-10-10 11:14:47 EDT
Well I am not in a position to reproduce the problem at the moment because
it has gone away. I am currently using a 2.1 build without my hack without
problems. The clearcase admins don't think anything has changed so it
must be a happy coincidence.

I've even tried setting my pc clock way out but cannnot reproduce. This
makes me think the problem could be caused by the clearcase servers not
being synched.

Nonetheless, I think I have explained what causes the problem. It is not
a bug in Eclipse. It is a bug in clearcase or a misconfiguration. Eclipse,
however, could be more sympathetic to the user.

e.g.
When compiling - write the class file anyway
When saving a source file - ask the user then save it anyway

BTW I only have problems accessing a clearcase dynamic view over samba, not
when accessing normal nfs files over samba.
Comment 34 Matthew Shaylor CLA 2002-10-10 11:20:44 EDT
Created attachment 2153 [details]
Output of the text program
Comment 35 Matthew Shaylor CLA 2002-10-10 11:24:54 EDT
I've tried the test program (output attached).  There is nothing untoward 
there :(  I still have the problem in eclipse though.  

Could it be the native implentation that is causing the problem?  I've looked 
at the code a bit more, and in the class 
org.eclipse.core.internal.localstore.CoreFileSystemLibrary there is a 
getLastModified(String fileName) method which can go to a native 
implementation.  Maybe this is the problem [wild guess]?

I am happy to test it but I have no CVS access (behind firewall) so if someone 
wants to build a version that forces eclipse to use the non-native call to 
getLastModified and e-mail it to me then I will test it.
Comment 36 Adalbert Homa CLA 2002-10-10 11:32:20 EDT
I tried the test program and here are the results (attached to a file).
I tried it with Eclipse (2.0.1) and I could not reproduce the problem anymore.
Clearcase and Samba is the same.

I did however upgrade from Windows NT to Windows 2K

Comment 37 Adalbert Homa CLA 2002-10-10 11:33:43 EDT
Created attachment 2154 [details]
Result of test program
Comment 38 Neil Swingler CLA 2002-10-10 13:00:44 EDT
Well if the timestamp discrepencies are caused by server clocks being out
of synch, there may be a problem with the test program waiting for
an exact multiple of 1 second. Might be worth waiting for a random number of ms
between each iteration and running for much longer. 
Comment 39 Matthew Shaylor CLA 2002-10-11 04:39:23 EDT
As suspected, I've changed the code in the file:
org.eclipse.core.internal.localstore.CoreFileSystemLibrary;
as follows:

public static long getLastModified(String fileName) {
	//if (hasNatives)
	//	return getLastModified(getStat(fileName));

	// inlined (no native) implementation
	return new File(fileName).lastModified();
}


By commenting out the "if (hasNatives)" clause and rebuilding the jar file I 
have removed the bug.  This, I think, conclusively shows that the problem is 
with the native routine.

I'll attach the modified file as it make a nice workaround.  But as Neil says, 
the actual problem is with Clearcase.  The only problem with eclipse is that it 
doesn't prompt the user with an option to overwrite or revert the file and then 
put itself back in synch.  I'm not entirely sure why this is, because for 
a "normal" concurrent modification eclipse does prompt with these options.
Comment 40 Matthew Shaylor CLA 2002-10-11 04:41:22 EDT
Created attachment 2165 [details]
A modified library to use the java io for fetching last-modified times.
Comment 41 Neil Swingler CLA 2002-10-11 04:53:40 EDT
I'm afraid the problem does not lie with using the native library.
See bug 19789.

If other sufferers are in a position to, could they try to get the
clearcase patches (5.0 patch 7) installed and check if that solves the problem.
My admins won't do it here.

John, are you in a position to discuss this with Rational. This might save
a lot of time if they actually know what causes the problem.
Comment 42 Neil Swingler CLA 2002-10-11 10:31:19 EDT
Reproduced with modified test program.

I started to get sporadic problems saving files in eclipse again  so I
decided to run the test program. I couldn't reproduce the problem with this
test.

I decided to cause the file to be read inbetween reading the first and second
timestamps and then the problem was reproduceable.

This is the output. I will attach the program.
===============================
Problem detected after 29 iterations in 30986 ms.
firstTime = 1034347853000
secondTime = 1034347852000
Problem detected after 27 iterations in 29518 ms.
firstTime = 1034347882000
secondTime = 1034347881000
Problem detected after 14 iterations in 12376 ms.
firstTime = 1034347894000
secondTime = 1034347893000
Problem detected after 3 iterations in 2828 ms.
firstTime = 1034347897000
secondTime = 1034347896000
Problem detected after 16 iterations in 22095 ms.
firstTime = 1034347919000
secondTime = 1034347918000
Problem detected after 10 iterations in 12751 ms.
firstTime = 1034347931000
secondTime = 1034347930000
Problem detected after 1 iterations in 844 ms.
firstTime = 1034347933000
secondTime = 1034347932000
Problem detected after 126 iterations in 138305 ms.
firstTime = 1034348072000
secondTime = 1034348071000
Problem detected after 55 iterations in 66411 ms.
firstTime = 1034348137000
secondTime = 1034348136000
Problem detected after 24 iterations in 26783 ms.
firstTime = 1034348165000
secondTime = 1034348164000
===============================
Note that we are currently using dos timestamps in samba with a 2 second
granularity to support visual studio users. I have experienced the saving
problem in eclipse even with dos timestamps switched off though.
Comment 43 Neil Swingler CLA 2002-10-11 10:33:41 EDT
Created attachment 2169 [details]
This test program will reproduce the problem
Comment 44 Adalbert Homa CLA 2002-10-11 11:33:37 EDT
I was able to reproduce the problem with the new test code.
Here is the result:
==================================================================
Problem detected after 423 iterations in 451188 ms.
firstTime = 1034350862000
secondTime = 1034350863000
Problem detected after 95 iterations in 102171 ms.
firstTime = 1034350963000
secondTime = 1034350964000
Problem detected after 142 iterations in 153078 ms.
firstTime = 1034351117000
secondTime = 1034351118000
Problem detected after 71 iterations in 72344 ms.
firstTime = 1034351190000
secondTime = 1034351191000
Problem detected after 21 iterations in 23094 ms.
firstTime = 1034351212000
secondTime = 1034351213000
Problem detected after 171 iterations in 182562 ms.
firstTime = 1034351395000
secondTime = 1034351396000
Problem detected after 295 iterations in 315688 ms.
firstTime = 1034351710000
secondTime = 1034351711000
Problem detected after 31 iterations in 27140 ms.
firstTime = 1034351737000
secondTime = 1034351738000
Problem detected after 93 iterations in 96157 ms.
firstTime = 1034351834000
secondTime = 1034351835000
Problem detected after 89 iterations in 104000 ms.
firstTime = 1034351937000
secondTime = 1034351938000

Comment 45 Matthew Shaylor CLA 2002-10-14 07:59:34 EDT
I ran the modified test program for 5 hours without any problems.  I'm speculating that perhaps the 
native routines are faster (in some sense) than the java routines and so cause me problems.  My 
samba connection might be sufficiently slow that I don't get any problems when using the java 
IO.

Does this sound plausable?
Comment 46 Neil Swingler CLA 2002-10-14 08:30:11 EDT
Can you find out what patch level of clearcase you are running.

According to 
http://www.rational.com/support/downloadcenter/addins/clearcase/plugins/readme_C
learCase_w.html

You should be at patch 7 for CC 5.0
Comment 47 Matthew Shaylor CLA 2002-10-14 09:01:37 EDT
We are on clearcase 4 still :(  I asked our admins, they plan to upgrade to 5 
at some point at which point they can look at applying patches.  Until then I'm 
stuck with the old version.
Comment 48 Neil Swingler CLA 2002-10-14 09:10:38 EDT
There is also a patch for 4.2 that fixes the same bug.

http://www.rational.com/techsupport/clearcase/tech/patchlink/new/htmlstreams/clearcase_p4.2.NT.html#clearcase_p4.2.NT-17
Comment 49 Neil Swingler CLA 2002-10-21 05:54:01 EDT
I found the following relevent clearcase bugs:
===============

Corrects a defect that could cause the modified time of a file in a dynamic
view with storage on a non-FAT file system to be set as much as two
seconds ahead of the current system time.

http://www.rational.com/techsupport/clearcase/tech/patchlink/new/htmlbugs/CMBU00059904.html
===============
Corrects a defect in the integration between ClearCase and IBM WebSphere
Studio Application Developer (WSS AD).
http://www.rational.com/techsupport/clearcase/tech/patchlink/new/htmlbugs/CMBU00060711.html

Comment 50 Neil Swingler CLA 2002-10-28 04:51:28 EST
Have applied Clearcase 5.0 NT patches 8 and 12. My test program still
reproduces the problems :-(
Comment 51 Urs Stuber CLA 2002-11-04 05:47:22 EST
We suffer from this problem, too. 5 Persons work with Eclipse/Clearcase, 3 
never get the problem and 2 nearly always. If we compare PC NT system times, 
they differ exactly this one second which also 
CoreFileSystemLibrary.getLastModified(stat) and info.getLocalSyncInfo() in 
FileSystemResourceManager.write() differ during our tests. We still use 
Clearcase 4.2 and will not upgrade soon. Before having found this bug report, 
we patched FileSystemResourceManager.write(), setting force=true, but testing 
for a 2 second difference is the better workaround, we'll change that.
Comment 52 Neil Swingler CLA 2003-02-10 10:45:16 EST
Created attachment 3389 [details]
Clearcase over samba workaround

My earlier workaround/hack applied to the M5 build
Comment 53 Neil Swingler CLA 2003-02-12 05:03:32 EST
Created attachment 3425 [details]
improved Clearcase over samba workaround

Found another place where timestamps are compared that occurred during
refactoring.
Comment 54 Neil Swingler CLA 2003-03-11 04:33:27 EST
I can keep updating my patch for the rc builds if anybody is interested.
Comment 55 Matthew Shaylor CLA 2003-03-11 04:43:23 EST
I'm interested although I must admit the last one didn't work for me :(  I 
would like to investigate furthur but I don't really have the time.

If only there was an "Overwrite Anyway" option on the error dialog.  Then I 
could live with it!
Comment 56 Neil Swingler CLA 2003-03-11 04:54:37 EST
Created attachment 3976 [details]
workaround patch for 2.1rc2
Comment 57 Neil Swingler CLA 2003-03-31 03:21:49 EST
Created attachment 4393 [details]
patch for 2.1 full release
Comment 58 Neil Swingler CLA 2003-06-20 03:45:36 EDT
Created attachment 5250 [details]
patch for 3.0M1
Comment 59 Neil Swingler CLA 2003-06-27 03:43:50 EDT
I finally got round to raising an issue with Rational. This was the reply:

"this is a known defect, RATLC00693656"

I can't find a way to view defects online though.

It would be nice to know whether XDE or WSAD suffer the same problems
since these will presumably be frequently used with Clearcase.
Comment 60 Neil Swingler CLA 2003-06-27 16:25:51 EDT
The full details of my enquiry to Rational support follows:

From: IBM Rational Software Customer Services (Europe)
Hi Neil,

actually, the development think it is. The thing is that is due to the MVFS
and cannot be fixed until schema 53 has been retired. At the moment I cannot
tell you when this will be.

-----Original Message-----
Hi Mikael,

I don't think this is the same problem. The java program I wrote to
reproduce the
bug does the following.

1. create a file
2. get it's last modified time
3. wait for a random time up to 2 seconds
4. read the file
5. get it's last modified time  (should be the same as from 2)

This is repeated until the 2 last modified times are different. This
generally happens
after about 10-15 iterations. The times always differ by 1 second, 2 when we
use
Samba Dos timestamp resolution.

The fact that the times are only out by 1 second makes me think it has
nothing to
do with the defect you told me about.

-----Original Message-----
From: IBM Rational Software Customer Services (Europe)
Hi Neil,

no, you cannot. All defects are logged in an internal database, and you will
only see those defects that has been fixed in a patch.

I cannot give you all the content in the defect, but here is the description
for it:

The creation time on files under version control displayed from windows 
explorer is not correct. If an element is checked out and you view the 
properties of the file, you see that the creation time of it is exactly the 
same as the last access time. Even worse, the access time is actually the
time 
when the properties windows gets open, not when the file was read last time.

The Windows Explorer gets the wrong information from the mvfs.

This is not a problem from a pure windows explorer perspective since the 
version tree browser provides the correct information on version creation
dates 
etc. But it is a problem when ClearCase interacts with other tools. Emacs
for 
example. From time to time Emacs wants to reload the file because it runs a 
stat on it and the information it receives is the same as the one windows 
explorer displays.

-----Original Message-----

Mikael,

can I view details of this defect on the www. I can't find it on
rational.net.

-----Original Message-----
From: IBM Rational Software Customer Services (Europe)
Dear Neil Swingler,
regarding your service request 190222159;

this is a known defect, RATLC00693656, and I have added you to the customer
list. You will be notified when this has been fixed.

-----Original Message-----
There has been a longstanding bug against eclipse:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=16280

Our environment is win NT client and solaris server using MVFS/samba and
dynamic views
I investigated this and found that MVFS doesn't return a consistent
timestamp for
files on the view server so this is a clearcase bug, not an eclipse bug. A
program is
attached to the bug that can demonstrate the problem.

Eclipse queries the file to get it's timestamp. Then it reads the file and
queries the
timestamp again. ~5% of the time, the 2 timestamps will differ by 1 second
(2 seconds
if Samba is configured to Dos timestamp resolution). Eclipse claims the
files are out
of sync and refuses to carry on doing whatever it is doing.

Client and server are Clearcase 5.0. Client is at fix pack 15.
Comment 61 Neil Swingler CLA 2003-08-29 05:06:51 EDT
I have created a new patch for 3.0m3:

http://uk.briefcase.yahoo.com/neil_swingler

and go to the eclipse folder

In 3.0m3 there is yet another place where the timestamp check is made that I
had to change.
Comment 62 Neil Swingler CLA 2003-09-09 14:45:47 EDT
The yahoo briefcase doesn't have public folders anymore so I've put the patch
at http://www.neil.swingler.name/eclipse/index.html instead
Comment 63 John Arthorne CLA 2003-09-11 12:19:02 EDT
I am going to close this bug report, since it has been raised as a bug against
Rational and they have acknowledged the bug.  This is not an Eclipse defect. 
Neil, you are welcome to continue posting your workaround here for those who are
interested - thank you for providing this. I hope you understand that this is
not an acceptable workaround for us to release into the core, but I'm glad that
it's alleviating the pain a bit.
Comment 64 Neil Swingler CLA 2003-09-11 18:50:40 EDT
I think you should be pragmatic and take into account the clearcase bug.
You are all IBM (for the moment). It is going to be a while before the
next Clearcase schema becomes available and could be many more years before
everybody is using it. Most users who pay lots of money for CC and WSAD will
never read this bug report or find out about my patch. They will just
get completely frustrated.
Comment 65 Neil Swingler CLA 2003-10-11 08:58:32 EDT
Patch for 3.0m4:

http://www.neil.swingler.name/eclipse/index.html
Comment 66 Neil Swingler CLA 2003-11-24 04:35:04 EST
Patch for 3.0m5:

http://www.neil.swingler.name/eclipse/index.html

Be patient, the connection is only 64 kbit/sec
Comment 67 Neil Swingler CLA 2003-11-28 08:22:01 EST
Sorry previous URL won't work. Try this one:
http://www.neil.swingler.name/eclipse
Comment 68 Neil Swingler CLA 2004-01-12 12:00:50 EST
3.0m6 version patch at:
http://www.neil.swingler.name/eclipse
Comment 69 John Arthorne CLA 2004-01-14 11:26:24 EST
*** Bug 28432 has been marked as a duplicate of this bug. ***
Comment 70 Neil Swingler CLA 2004-02-16 02:58:27 EST
3.0m7 version patch at:
http://www.neil.swingler.name/eclipse
Comment 71 Neil Swingler CLA 2004-06-28 10:18:26 EDT
Patch updated for 3.0 release

http://www.neil.swingler.name/eclipse

I will continue to update the patch for milestone builds but won't polute this
bug report with a comment each time.
Comment 72 Peter Hack CLA 2004-08-31 12:02:06 EDT
It turns out that this is *not* a bug in ClearCase.  It's a Samba bug.  Here 
are the details from the engineer that tracked this down:

When smbd receives SMB Transact2 SetFileInfo command setting the modification 
timestamp of the opened file, it keeps the timestamp in the pending_modtime 
field and skips utime(). (See call_trans2setfilepathinfo() 
in "source/smbd/trans2.c".) Thus, the follow-on SMB Transact2 QueryFileInfo 
command asking the modtime of this opened file returns the stale information 
(despite the fact that SetFileInfo command succeeded). The modtime is updated 
when SMB CloseFile command is received.

If Eclipse remembered the stale modtime (returned before SMB CloseFile, but 
after SMB Transact2 SetFileInfo), the next open will get the resource out of 
sync error (because the modtime has been changed).

Obviously, the simple fix in smbd is to call file_utime() in 
call_trans2setfilepathinfo() right after setting pending_modtime.
Comment 73 Neil Swingler CLA 2004-08-31 15:50:18 EDT
Thanks for the feedback.

Do you have a samba bug ID for that? Samba bugzilla search sucks even more than
eclipse bugzilla :-)
Comment 74 Neil Swingler CLA 2004-09-23 16:55:47 EDT
IBM raised this Samba bug:
https://bugzilla.samba.org/show_bug.cgi?id=1729
Comment 75 Neil Swingler CLA 2004-09-27 08:18:57 EDT
Patch updated for 3.0.1 and 3.1m2:
http://neil.swingler.name/eclipse
Comment 76 Marco Luescher CLA 2004-11-25 11:23:03 EST
The samba bug 1729 https://bugzilla.samba.org/show_bug.cgi?id=1729 has been 
fixed. It will be in Samba 3.0.10 !
Comment 77 Neil Swingler CLA 2004-12-20 11:41:47 EST
I have patched m4. Hopefully for the last time. Samba 3.0.10 is out but we can't
try it out right now. If anybody can try Samba 3.0.10, please report here
whether the problem is solved.
Comment 78 Nick Hemsley CLA 2005-02-12 04:32:31 EST
The fix for this bug appears to be in samba 3.0.11-pre1:
http://websvn.samba.org/cgi-bin/viewcvs.cgi/branches/SAMBA_3_0_RELEASE/source/smbd/trans2.c?rev=4348&view=markup

I haven't tested the official build yet (will test when 3.0.11 hits debian
testing) yet, but I have tested samba with the patch attached to the samba bug
for this problem, and it appears to make it much bette_, although I still get a
few (every 10-20 saves) 'resource out-of-sync' errors, perhaps due to differing
clocks on the client & server computer? I am not sure.
Comment 79 Neil Swingler CLA 2005-07-09 17:12:10 EDT
neil.swingler.name is now dead
The patch (now available for 3.1) is available at
http://swingler.ch/eclipse
Comment 80 Neil Swingler CLA 2006-03-17 09:16:56 EST
Created attachment 36486 [details]
patch for 3.2 m5

Since my website is in a bad state I will continue posting the patch here
Comment 81 Jan Kümmel CLA 2006-04-17 12:45:27 EDT
I just filed a similar bug which does still occur with samba 3.0.22 using cifs:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=137011