Query I as you said, the use of read-only query, the query does not block, but call txn.mutate(mutation);The thread is blocked again and remains unresponsive.
private void execDGraphQL(UgcNodeEntity newUgcNode) {
Transaction txn = dgraphClient.newTransaction();
try {
String json = JSON.toJSONString(newUgcNode);
logger.info("execDGraphQL json:{}", json);
// Run mutation
DgraphProto.Mutation mutation =
DgraphProto.Mutation.newBuilder().setSetJson(ByteString.copyFromUtf8(json)).build();
DgraphProto.Response res = txn.mutate(mutation);
logger.info("DGraph create response: {}", res.getJson().toStringUtf8());
txn.commit();
} finally {
txn.discard();
}
}
public class UgcNodeEntity {
private String uid;
private String type = "UGC";
private Long ugcId;
private Long ugcUid;
private Long rootUgcId;
private Integer isDeleted;
private Integer isRoot;
private Integer forwardCount;
private Long createTime;
private Long updateTime;
private DGraphNode forwardFrom;
}
- parking to wait for <0x00000006c46d6dd8> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.CompletableFuture$Signaller.block(CompletableFuture.java:1707)
at java.util.concurrent.ForkJoinPool.managedBlock(ForkJoinPool.java:3323)
at java.util.concurrent.CompletableFuture.waitingGet(CompletableFuture.java:1742)
at java.util.concurrent.CompletableFuture.join(CompletableFuture.java:1947)
at io.dgraph.Transaction.lambda$mutate$2(Transaction.java:97)
at io.dgraph.Transaction$$Lambda$1296/1777856840.get(Unknown Source)
at io.dgraph.ExceptionUtil.withExceptionUnwrapped(ExceptionUtil.java:18)
at io.dgraph.Transaction.mutate(Transaction.java:97)
at com.inveno.rrlike.graph.repository.ForwardUgcRepositoryWithDGraph.execDGraphQL(ForwardUgcRepositoryWithDGraph.java:418)
at com.inveno.rrlike.graph.repository.ForwardUgcRepositoryWithDGraph.updateOrInsertUgcNode(ForwardUgcRepositoryWithDGraph.java:137)
at com.inveno.rrlike.graph.repository.ForwardUgcRepositoryWithDGraph$$FastClassBySpringCGLIB$$141aa35f.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)