Similar to bug #432191, but with the History Tree backend. It's possible
for an attribute to be created, sent to the backend, and written to a
node, all while a query is ongoing. (That's a race condition where you
race a Formula 1 against a turtle, but the turtle somehow arrives first).
Simply ignore those new attributes, since their value at time 't' would be
null anyway.
Change-Id: I072a08e84795a321c3b2bb393d9880ac4ba13a6a
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Reviewed-on: https://git.eclipse.org/r/24674
Tested-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-by: Patrick Tasse <patrick.tasse@gmail.com>
for (int i = startIndex; i < intervals.size(); i++) {
/*
* Now we only have to compare the Start times, since we now the
- * End times necessarily fit
+ * End times necessarily fit.
+ *
+ * Second condition is to ignore new attributes that might have
+ * been created after stateInfo was instantiated (they would be
+ * null anyway).
*/
- if (intervals.get(i).getStartTime() <= t) {
- stateInfo.set(intervals.get(i).getAttribute(), intervals.get(i));
+ ITmfStateInterval interval = intervals.get(i);
+ if (interval.getStartTime() <= t &&
+ interval.getAttribute() < stateInfo.size()) {
+ stateInfo.set(interval.getAttribute(), interval);
}
}
} finally {