incubator-hugegraph icon indicating copy to clipboard operation
incubator-hugegraph copied to clipboard

[Question] Failed to handle cache event

Open simon824 opened this issue 3 years ago • 2 comments

Problem Type (问题类型)

No response

Before submit

  • [X] 我已经确认现有的 IssuesFAQ 中没有相同 / 重复问题

Environment (环境信息)

  • Server Version: v0.12.0
  • Backend: hbase
  • OS: xx CPUs, xx G RAM, Centos 7.x

Your Question (问题描述)

When I import data with spark-loader, the data can be written successfully, but a lot of WARN logs appear on the server side, I have no idea what is causing this

2022-08-04 11:43:59 [event-worker-1] [WARN] c.b.h.e.EventHub - Failed to handle event: Event{name='cache', args=[cleared, EDGE, null]}
java.lang.IllegalArgumentException: The args count of event 'cache' should be 2(actual 3)
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:163) ~[guava-25.1-jre.jar:?]
        at com.baidu.hugegraph.util.E.checkArgument(E.java:56) ~[hugegraph-common-2.1.2.jar:2.1.2.0]
        at com.baidu.hugegraph.event.Event.checkArgs(Event.java:53) ~[hugegraph-common-2.1.2.jar:2.1.2.0]
        at com.baidu.hugegraph.StandardHugeGraph$AbstractCacheNotifier.lambda$new$0(StandardHugeGraph.java:1517) ~[hugegraph-core-0.13.0.jar:0.13.0.0]
        at com.baidu.hugegraph.event.EventHub.lambda$notify$0(EventHub.java:160) ~[hugegraph-common-2.1.2.jar:2.1.2.0]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_281]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_281]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_281]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281]

Vertex/Edge example (问题点 / 边数据举例)

No response

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

No response

simon824 avatar Aug 04 '22 06:08 simon824

Looks like this is a bug.

we can update AbstractCacheNotifier:

event.checkArgs(String.class, HugeType.class);
=>
event.checkArgs(String.class, HugeType.class, Object.class);

https://github.com/apache/incubator-hugegraph/blob/6861f12662aa0e5ffada9cbdfb0bc8af1b38a23e/hugegraph-core/src/main/java/com/baidu/hugegraph/StandardHugeGraph.java#L1566

or it's better to update all places where ACTION_CLEARED is used:

this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE, null);
=>
this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE);

https://github.com/apache/incubator-hugegraph/blob/b991b6a13df9b19bba52e44b473d00bdcf678480/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java#L215

javeme avatar Aug 10 '22 23:08 javeme

Looks like this is a bug.

we can update AbstractCacheNotifier:

event.checkArgs(String.class, HugeType.class);
=>
event.checkArgs(String.class, HugeType.class, Object.class);

https://github.com/apache/incubator-hugegraph/blob/6861f12662aa0e5ffada9cbdfb0bc8af1b38a23e/hugegraph-core/src/main/java/com/baidu/hugegraph/StandardHugeGraph.java#L1566

or it's better to update all places where ACTION_CLEARED is used:

this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE, null);
=>
this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE);

https://github.com/apache/incubator-hugegraph/blob/b991b6a13df9b19bba52e44b473d00bdcf678480/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java#L215

Got it, thanks. I will fix it.

simon824 avatar Aug 11 '22 09:08 simon824