History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: UP-1683
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Andrew Petro
Reporter: Nick Fielding
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
uPortal

Cyclic reference between Nodes causes AggregatedLayout.getFirstSiblingNode getLastSiblingNode never to return

Created: 04/May/07 09:40 AM   Updated: 05/Mar/08 07:59 AM
Component/s: Aggregated Layouts
Affects Version/s: 2.3, 2.3.1, 2.3.2, 2.3.3, 2.3.4, 2.3.5, 2.4, 2.4.1, 2.4.2, 2.5.0 M1, 2.6.0 M1, 2.5.1 RC1, 2.5.0 RC1, 2.5.0 RC3, 2.5.0 RC2, 2.5.0 GA, 2.5.1 RC2, 2.5.2 RC1, 2.4.4, 2.4.3, 2.5.1 RC3, 2.5.1 GA, 2.4.3.1, 2.5.3 RC1, 2.5.2 GA, 2.5.3 RC2, 2.5.3 RC3, 2.5.3 GA, 2.6.0 RC1, 2.6.0 RC2, 2.5.3.1, 2.6.0 GA
Fix Version/s: 2.5.4, 3.0.0-M5, 2.6.1 RC1

Original Estimate: 5 minutes Remaining Estimate: 0 minutes Time Spent: 1 hour, 15 minutes
File Attachments: 1. File alm_head_AggregatedLayout_getFirstLastSibling_infiniteloop (2 kb)

Environment: Java 1.5_11 , Tomcat 5.5.20 , Solaris 10


 Description  « Hide
I discovered this problem when I noticed that the CPU usage was at a constant 50% after a load test, despite the fact the load test had completed and nothing else was using the portal. With YourKit and remote debugging I was able to pinpoint the cause.

There appears to be an issue with corrupt Aggregated Layouts where the previousNodeID of a set of nodes all reference one another.

e.g.

NodeID=40 references 39
NodeID=39 references 38
NodeID=38 references 40

Creating a cyclic reference. This causes a problem when invocating AggregatedLayout.getFirstSibling since the FOR loop will never complete as prevId will never be null.

This looks like a reasonably simple thing to fix by making sure prevId != nodeId after prevId = node.getPreviousNodeId(); on line 169 of AggregatedLayout.java . However, it doesn't address the issue of corrupt layouts.

Nick

 All   Comments   Work Log   Change History   FishEye      Sort Order:
Andrew Petro [16/Aug/07 06:04 PM]
Testing out addressing this issue in 2.4.2 ALM exploration branch, incidentally.

Andrew Petro [16/Aug/07 07:37 PM]
Patch against HEAD to add infinite loop check to AggregatedLayout getFirstSiblingNode and getLastSiblingNode. Instead of infnitely looping throws RuntimeException.

Andrew Petro [17/Aug/07 06:36 PM]
Fixed in 2-4-patches, 2-5-patches towards 2.5.4, 2-6-patches towards 2.6.1, and in HEAD towards uPortal 3.