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 176526

Summary: conflicts in /tmp/dlight_* or /var/tmp/dlight_* directory if 4 IDEs is started on one machine
Product: cnd Reporter: soldatov <soldatov>
Component: D-LightAssignee: Alexey Vladykin <alexey_vladykin>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Patch for Andrew's review

Description soldatov 2009-11-11 07:01:58 UTC
QA server (automatic testes) can launch 4 IDEs with different user directory on one machine. I think we have conflicts in /tmp/dlight_* or /var/tmp/dlight_* directory.
Comment 1 Alexey Vladykin 2009-11-12 02:46:24 UTC
There should be no conflicts, because DLight creates files in /tmp/dlight_* with random names. But I'll double check.
Comment 2 Alexey Vladykin 2009-11-12 03:50:48 UTC
Valera, do you have any evidence of conflicts?
Comment 3 soldatov 2009-11-12 04:20:17 UTC
No. Originally it was the question from issue 176167. What about /tmp/dlight_* or /var/tmp/dlight_*? Can we corrupt it, if 2 IDE is started? Mainly I had problems with cache from /tmp/*-cnd68-caches-0, but it is resolved. In latest test results I see very seldom exception only:

Unexpected exceptions found in message.log ([Caused: org.netbeans.modules.masterfs.filebasedfs.utils.FSException: Cannot get exclusive access to /export/hudson/workspace/cnd-test-sparc-S2-2/tests/build/test/qa-functional/data/cnd/projects/TestAddCppOrCFiles/testAddMainCppFile1/files/dir/dir/file.cpp (probably opened for reading).]):

But I think it is other problem.

First can not create and use /tmp/dlight_*/experiment_1.er directory, but second delete it?
Comment 4 Alexey Vladykin 2009-11-12 06:31:35 UTC
OK, so here is what I've found.

Potential conflicts on local host (there is some collision protection, but it works only within single NetBeans instance):
DerbyDataStorage.<init>() - creates new database in tmpdir/derby_dlight/ without checking that the database does not exist yet
H2DataStorage.<init>() - creates new database in tmpdir/h2_db_dlight/ without checking that the database does not exist yet
SunStudioDataCollector.init() - creates new experiment in tmpdir/ without checking that the experiment does not exist yet

Potential conflicts on remote host:
UnbufferSupport.initUnbuffer() - uploads unbuffer libs to remote tmpdir/bin/nativeexecution/
LLDataCollector.init() - uploads agent and monitor to remote tmpdir/tools/
Comment 5 Andrew Krasny 2009-11-12 06:44:29 UTC
Alexey, 

this issue was already discussed (and Valera was oresent, actually) ;)
But we already came to an agreement that we will have all dlight stuff in /var/tmp/dlight_username/${KEY}/...

where key is a hascode(?) of NBuserdir + local machine unique identifier.
Comment 6 Alexey Vladykin 2009-11-12 11:25:00 UTC
Created attachment 90937 [details]
Patch for Andrew's review
Comment 7 Alexey Vladykin 2009-11-13 08:44:09 UTC
Fixed in http://hg.netbeans.org/cnd-main/rev/e439810d0604
Thanks to Andrew for reviewing the fix.
Comment 8 Quality Engineering 2009-11-16 03:22:21 UTC
Integrated into 'main-golden', will be available in build *200911160201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e439810d0604
User: Alexey Vladykin <alexey_vladykin@netbeans.org>
Log: Bug #176526: conflicts in /tmp/dlight_* or /var/tmp/dlight_* directory if 4 IDEs is started on one machine