Bug Type (问题类型)
data inconsistency (计算结果不合预期)
Before submit
Environment (环境信息)
- Server Version: v1.0.x
- Computer Version: v1.0.x
Expected & Actual behavior (期望与实际表现)
Run org.apache.hugegraph.computer.algorithm.path.rings.RingsDetectionTest#testRunAlgorithm,
Vertex A expected result is:
[[A, C, A], [A, D, A], [A, B, C, A], [A, D, C, A], [A, C, E, D, A], [A, B, C, E, D, A]]
But got:
[[A, D, A], [A, D, A], [A, D, C, A], [A, D, C, A], [A, C, E, D, A], [A, B, C, E, D, A]]
I modified some code and it works.
@Override
public void compute(ComputationContext context, Vertex vertex,
Iterator<IdList> messages) {
Id id = vertex.id();
boolean halt = true;
while (messages.hasNext()) {
halt = false;
// IdList sequence = messages.next(); // Something is wrong here
IdList sequence = messages.next().copy(); // copy() is good
...
Further debug, I found messages.next() always return the same address Object(Field value may be different)!!!, it's a reference Object.
Semantically, I think messages.next() should return a different address Object.
Bug Type (问题类型)
data inconsistency (计算结果不合预期)
Before submit
Environment (环境信息)
Expected & Actual behavior (期望与实际表现)
Run
org.apache.hugegraph.computer.algorithm.path.rings.RingsDetectionTest#testRunAlgorithm,Vertex A expected result is:
But got:
I modified some code and it works.
Further debug, I found
messages.next()always return the same address Object(Field value may be different)!!!, it's a reference Object.Semantically, I think
messages.next()should return a different address Object.