This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 22203 - After unloading and reloading JavaCVS module, JavaCVS filesystem has local filesystem icon
Summary: After unloading and reloading JavaCVS module, JavaCVS filesystem has local fi...
Status: CLOSED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: CVS (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
: 24345 26622 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-04-08 21:31 UTC by _ tboudreau
Modified: 2007-01-04 17:14 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of the problem (8.24 KB, image/gif)
2002-04-08 21:31 UTC, _ tboudreau
Details
Snapshot of broken JavaCVS (7.84 KB, image/png)
2002-07-10 11:08 UTC, Jaroslav Tulach
Details
commit log. (1.78 KB, text/html)
2002-07-12 09:07 UTC, Milos Kleint
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2002-04-08 21:31:23 UTC
(Screenshot attached)
This may have been caused by several things, so here is 
what I did:

 - Installed a dev build (number visible in screenshot)
 - Mounted a CVS repository
 - Used it for several days.
 - Downloaded the JUnit and View over a Filesystem modules 
with the update center

When the IDE came back up after restarting to instal the 
modules, the CVS filesystem was still there, but had no 
contents.  The files were still there on disk.

I tried the following:
 - Tried recursive refresh - still no files
 - Hid the filesystem and re-showed it - still no files
 - Disabled the JUnit & View over a Filesystem modules to 
see if they were causing the problem - still no files
 - Added the "Refresh Folder" (in Options...Actions) 
action to a menu and tried that - still no files
 - Disabled the JavaCVS module and re-enabled it.  Now 
there are files, it is a JavaCVS filesystem, but the icon 
is wrong

The icon is trivial, but I'm reporting it since this is 
odd behaviour, and suggests that there might be other 
problems lurking somewhere.
Comment 1 _ tboudreau 2002-04-08 21:31:55 UTC
Created attachment 5325 [details]
Screenshot of the problem
Comment 2 Milos Kleint 2002-07-09 08:36:56 UTC
can this be a problem of early versions of treefs, yarda?
Comment 3 Jaroslav Tulach 2002-07-09 10:59:06 UTC
Finally someone else than just me realized this. It happens to me from
time to time. I have "all@netbeans.org" CVS repository mounted as one
filesystem and a lot of views over it (ten at least). 

Switching two such projects often results in the CVS filesystem to
become completely empty. Btw. my CVS filesystem is global (in
Tools/Options UserLayer, not project one), so it should not change.

In my opinion this is not bug in TreeFS, because the content of CVS
filesystem is empty and it should not be influence by view over it.



Comment 4 Milos Kleint 2002-07-09 13:35:45 UTC
can you reproduce it without the treefs? if not I assume it to be the
fault of treefs, rather then cvs filesystem.

Milos
Comment 5 Milos Kleint 2002-07-09 14:18:19 UTC
moving to treefs for deeper evaluation.
Comment 6 Jaroslav Tulach 2002-07-10 11:00:28 UTC
Milos, it is not true, I have explained to you that this is bug in
javacvs. If you want, I stop by and I can reproduce it for you.
Comment 7 Jaroslav Tulach 2002-07-10 11:08:16 UTC
Created attachment 6603 [details]
Snapshot of broken JavaCVS
Comment 8 Jaroslav Tulach 2002-07-10 11:09:47 UTC
As you can see on the previous snapshot, the CVS filesystem shows no
files under work directory, but LocalFS gives evidence that they are
there. Looks like a serious problem is not it?
Comment 9 Milos Kleint 2002-07-10 12:20:16 UTC
what's under the local filesystem in the picture? you have any treefs
mounted?
Comment 10 Milos Kleint 2002-07-10 12:54:22 UTC
what are the exact steps to reproduce? it works for me and I didn't
get similar problems for quite some time (6-9+ months) I've switched
several times the projects now, each with 10+ treefs over the cvs
filesystem at different levels of depth and cannot reproduce it.

BTW yarda you didn't explain anything. You just claim that it happens
for you after switching projects. and that it's not fault of treefs.
your claim here is based on the fact that the filesystem should expand. 

You also mentioned some non-standard setting of the filesystem on a
non-project layer.. May I assume all filesystems being on that level
or just the cvs one and the treefs filesystems over it are project based? 
That leads me to an assumption that the problem might lie in the
automount support, in code that switches projects or the serialization
of treefs. 
These explanations are as valid as is yours above IMO.
Comment 11 Jaroslav Tulach 2002-07-10 13:13:28 UTC
Milos, it is right that the environment around can cause all the
problems that the javacvs has, but these are really problems of
javacvs. I checked:

1. after start of the ide NbJavaCvsFileSystem@4bce3 is mounted
2. after switch to different project the same filesystem is mounted
3. its getRoot ().getChildren ().length == 0

So there is something wrong in the javacvs filesystem. I can reproduce
it everytime, stop by if you cannot.
Comment 12 Milos Kleint 2002-07-12 09:07:27 UTC
Created attachment 6634 [details]
commit log.
Comment 13 Milos Kleint 2002-07-12 09:15:44 UTC
fixed in trunk. 

diff (commit log attachement) attached.

[Martin, please review]

Description of the fix:
on multifilesystems it's not guaranteed that the uderlying
filesystem's addNotify and removeNotify methods will be called
subsequently and in the right order. With a simple test I figured that
the addNotify is called multiple times (for each treefs on it once)
1. in removeNotify it was attempted to clean up cache too agressively
without a counterpart in addNotify, the lost connection resulted in
empty filesystem. (only sometimes, depending on the garbage collection
cycle)
fixed by keeping reference to listener in filesystem so that the it's
weakListener is not gc-ed.
2. made creation/disposal of versioning filesystem synchronized. Only
the blocks that are posted to the request processor. 



Comment 14 Martin Entlicher 2002-07-15 15:07:36 UTC
The diff seems O.K. and safe to me.
Comment 15 Milos Kleint 2002-07-15 15:35:36 UTC
merged into the release34 branch
Comment 16 Jaroslav Tulach 2002-07-25 18:13:16 UTC
I have seen the issue again in post 3.4 builds that I am using.
Everytime I switch project, the javacvs is "emptied", very likely due
to unequal number of removeNotify & addNotify calls.
Comment 17 Martin Entlicher 2002-07-26 14:21:53 UTC
O.K., I'll look on it...
Comment 18 Martin Entlicher 2002-07-26 16:32:53 UTC
I've tested this at least 10 times with >20 treefs mounted from the
original javacvs filesystem. I've restarted IDE several times and
changed projects several times. Every time I was able to expand the
CVS filesystem and got the correct children.

Any hints how to reproduce this appreciated. Does the "no children
problem" appear only on the original CVS filesystem or on the treefs
also?

Comment 19 Jaroslav Tulach 2002-07-26 16:56:39 UTC
I can give you access to my machine, or show it to you. I am able to
reproduce it every time. 

No children problem is on JavaCVS, as a result each FS that delegates
to it will hava no children too. Ok?
Comment 20 Martin Entlicher 2002-07-26 18:49:20 UTC
Thanks for providing me the access to your machine!
After I've seen how it works on your machine and looked into the code
I was suprised, that it works on Solaris. The cache system was not
initialized fully after addNotify().

I was able to identify the problem and the changes I've made seems to
fix the problem on your machine completely.

Fixed in the main trunk.
Diffs:
http://javacvs.netbeans.org/source/browse/javacvs/src/org/netbeans/modules/javacvs/caching/CvsFsCache.java.diff?r1=1.29&r2=1.30
http://javacvs.netbeans.org/source/browse/javacvs/src/org/netbeans/modules/javacvs/JavaCvsFileSystem.java.diff?r1=1.85&r2=1.86
Comment 21 Jaroslav Tulach 2002-07-29 13:29:51 UTC
Switch of project succeeded now (used to fail before).
Comment 22 Jaroslav Tulach 2002-10-04 16:05:16 UTC
*** Issue 26622 has been marked as a duplicate of this issue. ***
Comment 23 Jaroslav Tulach 2002-10-04 16:09:27 UTC
*** Issue 24345 has been marked as a duplicate of this issue. ***
Comment 24 Martin Entlicher 2002-10-04 16:26:37 UTC
So this seems to be a bug in version 3.4 => changing version from 4.0
to 3.4 for sustaining reasons.
Comment 25 Martin Entlicher 2002-11-08 08:35:37 UTC
Adding 3.4.1_CANDIDATE, this should go into 3.4.1 IMHO.
Comment 26 Jaroslav Tulach 2002-12-03 09:53:50 UTC
Hi. This issue is marked as 3.4.1_CANDIDATE. It means that it should be
integrated into release341 one branch. The plan at
http://www.netbeans.org/devhome/docs/releases/34/index.html expected beta1 to be
produced on Dec01. That did not happen due to a lot of outstanding not
integrated candidates like this one. 

Would it be possible to spend few minutes by backporting this fix? Thank you in
advance.
Comment 27 Martin Entlicher 2002-12-05 13:46:38 UTC
Merged into release341 branch.
/cvs/javacvs/src/org/netbeans/modules/javacvs/JavaCvsFileSystem.java,v 
<--  JavaCvsFileSystem.java
new revision: 1.82.4.3.4.1; previous revision: 1.82.4.3
/cvs/javacvs/src/org/netbeans/modules/javacvs/caching/CvsFsCache.java,v 
<--  CvsFsCache.java
new revision: 1.28.6.1.4.1; previous revision: 1.28.6.1
Comment 28 Jaroslav Tulach 2003-02-05 10:30:22 UTC
Broken again in main trunk. What about writing a test to prevent
regressions?
Comment 29 Jiri Kovalsky 2003-02-05 10:59:16 UTC
Good idea, what do you think Daniel ?
Comment 30 Martin Entlicher 2003-02-06 11:15:17 UTC
I love these kinds of bugs, that somehow break by themselves without
any apparent reason :)

I'll look at it...
Comment 31 _ mihmax 2003-02-06 12:01:27 UTC
Please don't change the target milestone, otherwise how IZ 
can know, what has been fixed in 3.4.1?
http://www.netbeans.org/issues/buglist.cgi?
target_milestone=3.4.1

If you feel that this functionality is broken or you need 
a TASK to create a test, rather file a separate issue(s).
Comment 32 Martin Entlicher 2003-02-06 13:21:20 UTC
Well, yes. Maxym is right. This is fixed in 3.4.1 and thus should not
be reopened.

See issue #30763 for the problems in 3.5 dev builds.
Comment 33 Martin Entlicher 2003-02-06 13:22:39 UTC
Marking as verified - it was already verified.
Comment 34 Quality Engineering 2003-07-01 12:47:01 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.