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 33750

Summary: Race condition during copy/move/etc. possible fix
Product: platform Reporter: Jaroslav Tulach <jtulach>
Component: Data SystemsAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED FIXED    
Severity: blocker CC: asherman, cwebster, dkonecny, jglick, rkubacki
Priority: P1 Keywords: THREAD
Version: 3.x   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: The changes with a test case
Again and better - copy/move on folders works
Once again and perfectly?

Description Jaroslav Tulach 2003-05-19 19:44:44 UTC
In current data systems a thread can access
unfinished files copied/moved/createFromTemplated
by another Thread. This is simulated and fixed in
added attachement.

In addition to using runAtomicAction to prevent
event notifications the fix also prevents any
other thread from using DataObject.find and thus
accessing unfinished resources. 

This is dangerous if somebody is performing a long
running operation in the handleCopy, handleMove,
handleRename, handleCreateFromShadow methods
(probably DataFolder does), but still it looks
that it might be better to apply it (after
resolving the DataFolder problem).

Some evaluation please: Does it fix issue 33577?
Does it fix other problems? Thanks.
Comment 1 Jaroslav Tulach 2003-05-19 19:45:12 UTC
Created attachment 10337 [details]
The changes with a test case
Comment 2 _ rkubacki 2003-05-20 10:05:37 UTC
Thanks Jarda. I can't reproduce problem from #33577 anymore with the
patch but attempt to copy two folders (colorpicker and imageviewer) is
not finished and IDE is not functional after this.

Adding Andrew to CC so he can respond whether the approach is OK for
S1S. Namely bug #33244 can be fixed by this in a better way if we
resolve all problems.
Comment 3 David Konecny 2003-05-20 10:20:31 UTC
Assigning to Yarda.
Comment 4 Jaroslav Tulach 2003-05-20 12:31:10 UTC
Created attachment 10346 [details]
Again and better - copy/move on folders works
Comment 5 Andrew Sherman 2003-05-20 17:21:10 UTC
This sounds good. Thanks for working this issue.
Comment 6 Jaroslav Tulach 2003-05-22 10:05:52 UTC
Right now it is not possible to call DataFolder.getChildren from
inside the DataObject.handle* methods. This affects for example
PropertiesDataObject.handleMove. This will have to be fixed.
Comment 7 Jaroslav Tulach 2003-05-22 17:59:25 UTC
Created attachment 10383 [details]
Once again and perfectly?
Comment 8 Jaroslav Tulach 2003-05-28 10:04:29 UTC
Integrated. David any deadlocks during copy/move/etc. operations
assign to me.


Checking in loaders/manifest.mf;
/cvs/openide/loaders/manifest.mf,v  <--  manifest.mf
new revision: 1.5; previous revision: 1.4
done
Processing log script arguments...
Mailing the commit message to cvs@openide.netbeans.org (from
jtulach@netbeans.org)
Checking in loaders/api/apichanges.xml;
/cvs/openide/loaders/api/apichanges.xml,v  <--  apichanges.xml
new revision: 1.2; previous revision: 1.1
done
Processing log script arguments...
Mailing the commit message to cvs@openide.netbeans.org (from
jtulach@netbeans.org)
Checking in loaders/src/org/openide/loaders/DataObject.java;
/cvs/openide/loaders/src/org/openide/loaders/DataObject.java,v  <-- 
DataObject.java
new revision: 1.4; previous revision: 1.3
done
Checking in loaders/src/org/openide/loaders/DataObjectPool.java;
/cvs/openide/loaders/src/org/openide/loaders/DataObjectPool.java,v 
<--  DataObjectPool.java
new revision: 1.4; previous revision: 1.3
done
Checking in loaders/src/org/openide/loaders/DataShadow.java;
/cvs/openide/loaders/src/org/openide/loaders/DataShadow.java,v  <-- 
DataShadow.java
new revision: 1.3; previous revision: 1.2
done
Checking in loaders/src/org/openide/loaders/DataTransferSupport.java;
/cvs/openide/loaders/src/org/openide/loaders/DataTransferSupport.java,v
 <--  DataTransferSupport.java
new revision: 1.3; previous revision: 1.2
done
Checking in loaders/src/org/openide/loaders/FolderList.java;
/cvs/openide/loaders/src/org/openide/loaders/FolderList.java,v  <-- 
FolderList.java
new revision: 1.3; previous revision: 1.2
done
Checking in loaders/src/org/openide/loaders/InstanceDataObject.java;
/cvs/openide/loaders/src/org/openide/loaders/InstanceDataObject.java,v
 <--  InstanceDataObject.java
new revision: 1.4; previous revision: 1.3
done
Processing log script arguments...
Mailing the commit message to cvs@openide.netbeans.org (from
jtulach@netbeans.org)
RCS file:
/cvs/openide/test/unit/src/org/openide/loaders/SeparationOfThreadsTest.java,v
done
Checking in
test/unit/src/org/openide/loaders/SeparationOfThreadsTest.java;
/cvs/openide/test/unit/src/org/openide/loaders/SeparationOfThreadsTest.java,v
 <--  SeparationOfThreadsTest.java
initial revision: 1.1
done