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 165223 - NodeOp.factory -> NodeOp.findPath unreliable
Summary: NodeOp.factory -> NodeOp.findPath unreliable
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Nodes (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks: 161286 164397
  Show dependency tree
 
Reported: 2009-05-14 23:40 UTC by Jesse Glick
Modified: 2009-05-20 07:33 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Log from one failure (48.54 KB, text/plain)
2009-05-18 13:22 UTC, Jaroslav Tulach
Details
Log files from good and bad runs (8.35 KB, application/x-compressed)
2009-05-18 13:39 UTC, Jaroslav Tulach
Details
possible FilterNode patch (784 bytes, text/plain)
2009-05-19 14:16 UTC, t_h
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2009-05-14 23:40:10 UTC
Similar to issue #164397.
Comment 1 Jesse Glick 2009-05-14 23:43:29 UTC
Added randomly failing LazyNodeTest.testFindChild in cdev #e74619f77207.
Comment 2 Quality Engineering 2009-05-15 18:57:38 UTC
Integrated into 'main-golden', will be available in build *200905151401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e74619f77207
User: Jesse Glick <jglick@netbeans.org>
Log: #165223 demonstration that NodeOp.factory -> NodeOp.findPath unreliable.
Comment 3 Jaroslav Tulach 2009-05-18 13:22:01 UTC
Created attachment 82305 [details]
Log from one failure
Comment 4 Jaroslav Tulach 2009-05-18 13:39:48 UTC
Created attachment 82309 [details]
Log files from good and bad runs
Comment 5 Jaroslav Tulach 2009-05-18 13:52:28 UTC
I go not think there is anything wrong in LazyNode. Rather there is some interaction between GC, FilterNode and 
ChildFactory. I've added more logging: ergonomics#ae6d1b86bd19 and generated two logs (attached in the ZIP 
http://www.netbeans.org/nonav/issues/showattachment.cgi/82309/testFindChild.zip). The successful run seems to execute 
a lot of operations in Mutex mode 1, while the unsuccessful runs in mode 2. Also the "addNotify successfully called 
for org.openide.nodes.FilterNode$Children" happens at the end of the run in the successful turn, while quite early in 
the failed one.

Anyway I do not think the failure is LazyNode related and I'd like Tomáš to investigate it.
Comment 6 t_h 2009-05-19 14:14:22 UTC
The problem seems to me in the fact that LazyNode switches original node while operation is running on the original
(createKeys() is invoked from blocking call of findChild()). FilterNode (LazyNode) assumes findChild() successfully
finished on original node (blocking call in case of AsynchChildren), but it did not on new switched original.
changeOriginal() causes refresh of filter nodes keys, but only via original.getChildren().getNodes() which does not
block and therefore new original (which also has AsynchChildren) may return just wait node.

It is possible to check original in FilterNode (after original.getChildren().findChild()) and call findChild() again if
original was changed, but it is not very clean fix. I think it would be better to rewrite LazyNode.
Comment 7 t_h 2009-05-19 14:17:52 UTC
Created attachment 82396 [details]
possible FilterNode patch
Comment 8 Jaroslav Tulach 2009-05-19 14:58:33 UTC
Thanks for finding what is wrong.

core-main#e5cbc4b239c3
Comment 9 Jesse Glick 2009-05-19 17:29:51 UTC
Works. Clicking a broken build notification now correctly expands Hudson Builders, as well as some appropriate
descendants, to select the build node.
Comment 10 Quality Engineering 2009-05-20 07:33:46 UTC
Integrated into 'main-golden', will be available in build *200905200201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e5cbc4b239c3
User: Jaroslav Tulach <jtulach@netbeans.org>
Log: #165223: Capture the request to switchToOriginal when FilterNode's children are being expanded, not when the underlaying ones are