Bug 160031 - Log records not visible when importing multiple CBE logs at one time
Summary: Log records not visible when importing multiple CBE logs at one time
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP.monitoring (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 critical (vote)
Target Milestone: ---   Edit
Assignee: amehrega CLA
QA Contact:
URL:
Whiteboard: closed460
Keywords: plan
: 176618 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-06 11:02 EDT by Peter Kim CLA
Modified: 2010-06-03 15:09 EDT (History)
7 users (show)

See Also:


Attachments
Logs (9.74 KB, application/zip)
2006-10-06 11:02 EDT, Peter Kim CLA
no flags Details
Error (246.35 KB, image/jpeg)
2006-10-06 11:03 EDT, Peter Kim CLA
no flags Details
Patch (2.38 KB, patch)
2007-03-14 18:06 EDT, amehrega CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Kim CLA 2006-10-06 11:02:01 EDT
Build:
tptp.sdk-TPTP-4.3.0-200610060112
IBM JRE 5 SR 3

Steps to reproduce:
1) Import the CBE files attached into Eclipse all at once.
2) Open each of the logs in the log navigator.

Actual Results:
Some logs show the proper number records, while others state there are 0 of 0 records, and some that state there are 0 of 44 records, with no filter being applied.

Expected Results:
Logs records of all logs should be shown in log view

Additional Information:
Importing the logs one by one, or replacing logs that don't show records, shows the records properly.
Comment 1 Peter Kim CLA 2006-10-06 11:02:28 EDT
Created attachment 51549 [details]
Logs
Comment 2 Peter Kim CLA 2006-10-06 11:03:26 EDT
Created attachment 51550 [details]
Error
Comment 3 Valentina Popescu CLA 2006-10-06 11:05:03 EDT
Alex is on vacation; you may want to redirect the bug
Comment 4 Eugene Chan CLA 2006-10-10 11:45:41 EDT
I cannot reproduce problem with the latest candidate build TPTP-4.3.0-200610090100.
I unzipped the logs.zip into my local file system, and import the 10 cbe files into workbench. All 10 logs are imported fine with no error reports. Each of them contains 44 records.
Comment 5 Eugene Chan CLA 2006-10-10 11:46:38 EDT
works for me
Comment 6 Peter Kim CLA 2006-10-11 15:14:29 EDT
I was able to reproduce the problem on my machine using the latest TPTP 4.2.1 driver, so the problem existed before Sheldon's refractoring. The problem is occuring only on multithreaded machines.
Comment 7 Eugene Chan CLA 2006-10-11 15:34:24 EDT
rasing to P1 major
Comment 8 Eugene Chan CLA 2006-10-30 10:13:03 EST
Alex, please take a look.
Comment 9 Dave Smith CLA 2006-11-03 11:55:37 EST
Deferring this to 4.4 with approval from TPTP PG (given on 11/01/06).  It cannot be contained in 4.3.

Alex, please open a defect to add a readme item for it in 4.3.
Comment 10 Alex Nan CLA 2007-01-12 14:57:38 EST
Need investigation, provide rough estimate of 12h.
Comment 11 Dave Smith CLA 2007-02-06 14:39:52 EST
Targetting to iteration 3 and increasing priority to indicate it is planned for
4.4.
Comment 12 Alex Nan CLA 2007-03-08 00:47:00 EST
*** Bug 176618 has been marked as a duplicate of this bug. ***
Comment 13 Alex Nan CLA 2007-03-11 13:52:33 EDT
Raising to critical as requested by a consuming product.
Comment 14 amehrega CLA 2007-03-14 17:56:25 EDT
The problem was caused by colliding URIs when creating agents.  The collision of URIs caused the loaders to write the data to the wrong agent.  I introduced a static counter to reduce the chance of collision.
Comment 15 amehrega CLA 2007-03-14 18:06:39 EDT
Created attachment 60870 [details]
Patch

Alex,

Please check-in the patch.
As discussed, you'll need to have the latest copy of org.eclipse.hyades.logging.adapter checked out if you would like to verify the patch.
Comment 16 amehrega CLA 2007-03-14 19:01:44 EDT
Created this test case under org.eclipse.tptp.monitoring.tests\gui\Monitor.UI.ImportLog\Monitor.UI.ImportLog.Part1.ImportMultipleCBELogFiles
Comment 17 Alex Nan CLA 2007-03-14 19:07:29 EDT
I have reviewed, tested and checked in the patch. Please mark the defect as being fixed. 
Thanks.
Comment 18 Marius Slavescu CLA 2007-03-15 09:30:42 EDT
(In reply to comment #15)
If you want to make it thread-safe you could create a syncronized method that will provide the unique ID(counter), you could place that method in a utility class where it would become reusable.

Also instead of a counter you could use the System.currentTimeMillis() value and increment it only if it is <= last value of the ID (which is stored in a static field and updated on each call of getNextUniqueTimeID() method).

Even when using this method if you want to make sure that the new resource doesn't collide with an existing one then you should check if such resource exist in the workspace already (althogh this case if very unlikely to happen when using the currentTimeMillis as the ID).

Comment 19 amehrega CLA 2007-03-15 09:43:34 EDT
>(In reply to comment #18)
The URI was already using a time stamp.  The collisions were happenning because agents were being created in less than one millisecond apart.
Comment 20 Marius Slavescu CLA 2007-03-15 10:11:20 EDT
Then fix the original timestamp instead of adding another element there, the file name is already too long.
Comment 21 amehrega CLA 2007-03-15 10:26:42 EDT
(In reply to comment #20)
As discussed (in person), I don't have access to the time stamp where I append the counter.  Please feel free to assign it to yourself and increment the time stamp if you think that the fix is not sufficient.
Comment 22 Marius Slavescu CLA 2007-03-15 10:32:44 EDT
(In reply to comment #21)

I already explained my concerns with this approach so I'll let the component owner to decide if the fix is appropiate or not and if it covers all the scenarios.


Comment 23 Alex Nan CLA 2007-03-15 10:53:03 EDT
I think for now the solution provided by Ali is sufficient. Perhaps a synchronized counter would have been a more safer solution indeed but this is working for now and solves the problem and giving the current time constraints that we have I think it's OK. If we encounter any problems in the future then we'll take it from there.
Comment 24 Alex Nan CLA 2007-03-15 12:15:15 EDT
Just to be on the safe side I've added a synchronized block and a counter method.
Comment 25 Paul Slauenwhite CLA 2009-06-30 10:26:04 EDT
As of TPTP 4.6.0, TPTP is in maintenance mode and focusing on improving quality by resolving relevant enhancements/defects and increasing test coverage through test creation, automation, Build Verification Tests (BVTs), and expanded run-time execution. As part of the TPTP Bugzilla housecleaning process (see http://wiki.eclipse.org/Bugzilla_Housecleaning_Processes), this enhancement/defect is verified/closed by the Project Lead since the originator of this enhancement/defect has an inactive Bugzilla account and considered to be fixed. If this enhancement/defect is still unresolved and reproducible in the latest TPTP release (http://www.eclipse.org/tptp/home/downloads/), please re-open.