Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339313

Summary: Revision may contain CDOList with uninitialized values
Product: [Modeling] EMF Reporter: Caspar D. <caspar_d>
Component: cdo.coreAssignee: Caspar D. <caspar_d>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: normal    
Priority: P3 CC: saulius.tvarijonas
Version: 4.0Flags: stepper: review+
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Stacktrace
none
Testcase (as a patch)
none
Patch none

Description Caspar D. CLA 2011-03-09 00:34:34 EST
Created attachment 190727 [details]
Stacktrace

Consider the attached stacktrace which was dumped by a CDOServer running
with a DB store.

Apparently its possible somehow, under certain circumstances, for a
CDOList to remain uninitialized, i.e. for it to contain instances of 
CDORevisionUtil.Uninitialized

Further observations:

- Clearing the server revision cache solves the problem.

- Before the problem occurred, a client had been killed. (It's not
certain whether this has any bearing on the problem or not.)

- The UNINITIALIZED value is only added to CDOList in 2 locations:
  1. CDOListImpl.CDOListImpl (the constructor)
  2. AbstractHorizontalClassMapping.readValuesFromStatement
Comment 1 Caspar D. CLA 2011-03-21 05:26:22 EDT
From a code review, it seems to me that one way this could happen
is for prefetching to be combined with chunking. When chunking is
used, some of the elements in an isMany reference will remain set
to 'CDORevisionUtil.Uninitialized', but the code in 
LoadRevisionsIndication.prefetchRevision seems to assume that all
elements in such a collection can be cast to CDOID.

But then, I've never used chunking and/or prefetching, so I'm not
too sure I'm right about this. Any comments would be welcome...
Comment 2 Caspar D. CLA 2011-03-22 01:44:08 EDT
Created attachment 191656 [details]
Testcase (as a patch)

Test fails for DB repo configs.
Comment 3 Caspar D. CLA 2011-03-22 02:00:26 EDT
Created attachment 191657 [details]
Patch
Comment 4 Eike Stepper CLA 2011-03-22 14:08:08 EDT
Looks good to me.
Comment 5 Caspar D. CLA 2011-03-22 22:50:15 EDT
Committed revision 7576.
Comment 6 Eike Stepper CLA 2011-06-23 03:36:49 EDT
Available in R20110608-1407