Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 355205 - File checkout randomly fails for a file unstaged a moment before
Summary: File checkout randomly fails for a file unstaged a moment before
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 1.1   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Christian Halstrick CLA
QA Contact:
URL: http://egit.eclipse.org/r/4047
Whiteboard:
Keywords:
Depends on:
Blocks: 352348
  Show dependency tree
 
Reported: 2011-08-19 07:42 EDT by Tomasz Zarna CLA
Modified: 2011-09-29 12:57 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Zarna CLA 2011-08-19 07:42:29 EDT
Similar to bug 353867, but this time I managed to prepare a failing test without setting core.aurocrlf is set to true. So it's not caused by bug 301775. The only problem with the test is that it doesn't fail all the time, thus the loop.
Comment 1 Tomasz Zarna CLA 2011-08-19 08:53:20 EDT
Kevin, you seem to be the right person to ask what's going on here. You added the org.eclipse.jgit.api.CheckoutCommand.checkoutPaths() method. I'm eager to start working on a fix if someone give me some tips where to start. Could you?
Comment 2 Tomasz Zarna CLA 2011-08-19 10:54:49 EDT
FWIW it fails on Linux as well, but it takes longer: after 30+ iterations when on Windows it happens usually after 2-5 attempts.
Comment 3 Chris Aniszczyk CLA 2011-08-19 11:29:37 EDT
Shawn, any thoughts?
Comment 4 Kevin Sawicki CLA 2011-08-19 12:19:20 EDT
(In reply to comment #1)
> Kevin, you seem to be the right person to ask what's going on here. You added
> the org.eclipse.jgit.api.CheckoutCommand.checkoutPaths() method. I'm eager to
> start working on a fix if someone give me some tips where to start. Could you?

I'm not sure what is going on, but you only see it when doing a selective patch checkout?
Comment 5 Kevin Sawicki CLA 2011-08-19 12:20:00 EDT
(In reply to comment #4)
> I'm not sure what is going on, but you only see it when doing a selective patch
> checkout?

*selective path
Comment 6 Tomasz Zarna CLA 2011-08-19 12:38:38 EDT
(In reply to comment #4)
> I'm not sure what is going on, but you only see it when doing a selective patch
> checkout?

Yep, checking out branches works fine.
Comment 7 Christian Halstrick CLA 2011-09-27 12:52:29 EDT
I think the problem (and a solution) is found. See http://egit.eclipse.org/r/#change,4296. Selective checkouts potentially left the index in an inconsistent state. Even native git tools have been confused by the index we produced. What also fits is that this problem is related to timing & platform. If you are very fast (e.g. when adding, committing very fast in junit test) then index entries get smudged (their lenght is set to 0) and wrong length information is not persisted - which is good in this case. And the smuding behaviour is quite different on different filesystems (platforms).

Tomasz, could you confirm that with the solution in the listed change you don't see that problem anymore?
Comment 8 Tomasz Zarna CLA 2011-09-28 05:40:15 EDT
Yup, I can confirm that the fix from http://egit.eclipse.org/r/#change,4296 makes my test from http://egit.eclipse.org/r/4047 no longer fail. I would suggest copying the test to http://egit.eclipse.org/r/#change,4296, but given the way it works I'm afraid it's no use. I've also verified that with your fix, tests I prepared for bug 352348 pass now. The bad news is that test from bug 353867 (http://egit.eclipse.org/r/3957) still fails, but I haven't looked at it more carefully.

Let me know if I can be of any more help.
Comment 9 Matthias Sohn CLA 2011-09-28 18:41:08 EDT
change 4296 was merged as 1230d353d8583acfd0df5b3ecdd6aeb04817c692

can we close this now ?
Comment 10 Tomasz Zarna CLA 2011-09-29 08:02:20 EDT
Yes. Works like a charm now. Thanks!
Comment 11 Kevin Sawicki CLA 2011-09-29 12:57:32 EDT
Resolving as fixed