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 52318 - PVCS, VSS: After "Add All" commands should be stopped from Runtime tab.
Summary: PVCS, VSS: After "Add All" commands should be stopped from Runtime tab.
Status: CLOSED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: vcsgeneric (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P1 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2004-12-13 12:55 UTC by Peter Pis
Modified: 2006-03-24 13:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
output of runtime tab (14.78 KB, image/gif)
2004-12-13 12:57 UTC, Peter Pis
Details
thread dump (9.92 KB, text/plain)
2004-12-20 13:59 UTC, Peter Pis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Pis 2004-12-13 12:55:49 UTC
NB 041209, jdk1.5.0_01, turboCache On

Steps:
1. Register new versioned directory and create in
it a project.
2. Switch to "Files" view and invoke e.g."VSS |
Add All" (check Add all recursively, push "Ok" button)

Refresh and other commands are running, they have
to be stopped manualy. See attached figure. 

In case of PVCS situation is similar.
Comment 1 Peter Pis 2004-12-13 12:57:39 UTC
Created attachment 19252 [details]
output of runtime tab
Comment 2 _ pkuzel 2004-12-13 19:06:03 UTC
From debugging it looks like race condition in CommandExecutorSupport.
It simply forgets to call Refresh Recursively and refresh maps merging.

Can you Refresh Recursively under Runtime?
Comment 3 _ pkuzel 2004-12-14 09:25:46 UTC
Well, my previous comment is linked to my attempt to reproduce. I got
into missing refresh command trouble. 

It's FIXED now, I have commented out performance optimalizations in
CES that merges refreshes.

CommandExecutorSupport.java new revision: 1.64.2.9

With the fix I cannot reproduce original problem.

BTW: You cannot trust Runtime tab icons entirerly. They sometimes do
not show real state try to compare to exit status property.
Comment 4 Peter Pis 2004-12-14 09:40:22 UTC
Some commands in Runtime tab fail because there is make an attempt to
add files and folders to the repository more than once. This happens
after PVCS | Add All action.

===
ADD_FILES_IN_DIR: (Error output)
Warning: D:\SunWork\test\testPVCS\work\TestApp2\build.xml: Could not
add the file because a versioned file already exists.
Warning: D:\SunWork\test\testPVCS\work\TestApp2\manifest.mf: Could not
add the file because a versioned file already exists.

===
ADD_IN_FOLDER_CMD:
10:28:50 Dec.14.04 [Error] 
A Project named "TestApp2" already exists in ProjectRoot named
"Project Database".
Please enter a unique name for the Project.

Comment 5 Peter Pis 2004-12-14 17:12:32 UTC
Verified.
Comment 6 Peter Pis 2004-12-17 14:38:35 UTC
VSS Add All doesn't work correctly. Neither all folders nor files are
added.
Comment 7 Peter Pis 2004-12-17 14:48:08 UTC
Also "PVCS Add All" doesn't work correctly. Commands like
"ADD_FILES_IN_DIR", "ADD_IN_FOLDER_CMD", ... have to be stopped from
Runtime tab. In Previsious turbo Cache build it works fine, but now it
doesn't. Regression. P1.
Comment 8 Martin Entlicher 2004-12-17 15:24:58 UTC
Starting to search what is wrong...
Comment 9 Martin Entlicher 2004-12-17 16:45:16 UTC
The problem is, that when the folder with sub-files is not yet
expanded in Explorer (status info is not yet defined), its content is
not added.
If the folder is fully expanded, all files are successively added.

I've looked at the recent changes, but did not find the cause yet...
Comment 10 _ pkuzel 2004-12-20 10:09:44 UTC
Peter can you support Martin's observation?

Then I predict simple fix: replacing getCachedMeta() call by
getMeta(). And let offline mode takes care of the rest.
Comment 11 _ pkuzel 2004-12-20 11:11:30 UTC
At PVCS profile I see:

        <property name="preCommands">
          <value>$[? CACHED_ISLOCAL] [CREATE_PROJECT] []</value>
        </property>

CACHED_ISLOCAL is bug, because it relies on cached status. The
variable is not mandatory. 

FIX: I'll change at UserCommandSupport to set this variable even if
status is not yet cached (it makes sence here). It's a kind of
predicted fix.
Comment 12 Peter Pis 2004-12-20 13:59:44 UTC
Created attachment 19364 [details]
thread dump
Comment 13 _ pkuzel 2004-12-20 16:55:53 UTC
Almost all threads wait on
CommandTask.waitFinished(CommandTask.java:212) => missing notification.

Looking at the line there are another errors:
 - "if" instead of "while" 
 - missing synchronization on "notifyLock" (eliminates missing notif.)

but fixing them raises regresion. The infrastructure relies on these
bugs :-(.
Comment 14 Martin Entlicher 2005-01-03 14:07:59 UTC
These are not bugs in fact, "while" is not necessary, because once the
task finishes, it should not be run again.
(Well it seems to be possible to run the task again by explicit call
to CommandTask.run(). This should not be permitted IMO - I'll fix it.)
Synchronization on "notifyLock" looks O.K. to me.

This bug is caused by the fact that ADD_IN_FOLDER_CMD command executes
ADD_INSIDE_FOLDER_CMD as a post command, but the customization process
is done synchronously with the execution of ADD_IN_FOLDER_CMD command.
The customization process needs to run DUMP_FILES_FOR_ADD_IN_FOLDER
command because of FILE_EMPTY_OUTPUT_OF_DUMP_FILES_FOR_ADD_IN_FOLDER0
construction used in it's execution string. The
DUMP_FILES_FOR_ADD_IN_FOLDER command uses RecursiveFolderCommand to
retrieve the desired list of files, but it needs to consult the status
cache on repository level. This invokes Refresh command. But the
LIST_PROJECT command, that is executed by Refresh can not be run in
parallel with ADD_IN_FOLDER_CMD command. Therefore the commands remain
waiting for each other. The solution is to perform the customization
of post-commands asynchronously.
Comment 15 Martin Entlicher 2005-01-03 14:23:17 UTC
The CommandTask can not be run more then once:

/cvs/vcscore/src/org/netbeans/api/vcs/commands/CommandTask.java,v  <--
 CommandTask.java
new revision: 1.6.44.2; previous revision: 1.6.44.1

The customization process of post-commands is done asynchronously:

/cvs/vcscore/src/org/netbeans/modules/vcscore/commands/CommandExecutorSupport.java,v
 <--  CommandExecutorSupport.java
new revision: 1.64.2.11; previous revision: 1.64.2.10

The bug is therefore fixed on turbo branch.
Comment 16 Peter Pis 2005-01-04 12:39:36 UTC
Verified.