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

Edge insert error com.baidu.hugegraph.rest.ClientException: Failed to do request

Open charriyu opened this issue 7 years ago • 2 comments

在使用Habse作为存储后端时,需要使用loader导入1亿个顶点和100亿条边的图数据,我们采用的是使用先将顶点数据导入后再导入边数据,但是出现SocketTimeoutException: Read timed out错误。错误信息如下 2019-04-19 13:43:33 17776621 [pool-3-thread-1] [ERROR] com.baidu.hugegraph.loader.task.TaskManager [] - Edge insert error com.baidu.hugegraph.rest.ClientException: Failed to do request at com.baidu.hugegraph.rest.RestClient.request(RestClient.java:69) ~[hugegraph-common-1.5.3.jar:1.5.3.0] at com.baidu.hugegraph.rest.RestClient.post(RestClient.java:115) ~[hugegraph-common-1.5.3.jar:1.5.3.0] at com.baidu.hugegraph.rest.RestClient.post(RestClient.java:79) ~[hugegraph-common-1.5.3.jar:1.5.3.0] at com.baidu.hugegraph.rest.RestClient.post(RestClient.java:74) ~[hugegraph-common-1.5.3.jar:1.5.3.0] at com.baidu.hugegraph.api.graph.EdgeAPI.create(EdgeAPI.java:49) ~[hugegraph-client-1.6.4.jar:1.6.4.0] at com.baidu.hugegraph.driver.GraphManager.addEdge(GraphManager.java:167) ~[hugegraph-client-1.6.4.jar:1.6.4.0] at com.baidu.hugegraph.loader.task.TaskManager.lambda$submitEdgesInSingleMode$1(TaskManager.java:236) ~[hugegraph-loader-0.8.0.jar:?] at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:108) [guava-19.0.jar:?] at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:41) [guava-19.0.jar:?] at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:77) [guava-19.0.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_192] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_192] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_192] Caused by: javax.ws.rs.ProcessingException: java.net.SocketTimeoutException: Read timed out at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:287) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.internal.Errors.process(Errors.java:228) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343) ~[jersey-client-2.25.1.jar:?] at com.baidu.hugegraph.rest.RestClient.lambda$post$0(RestClient.java:116) ~[hugegraph-common-1.5.3.jar:1.5.3.0] at com.baidu.hugegraph.rest.RestClient.request(RestClient.java:67) ~[hugegraph-common-1.5.3.jar:1.5.3.0] ... 12 more Caused by: java.net.SocketTimeoutException: Read timed out at java.net.SocketInputStream.socketRead0(Native Method) ~[?:1.8.0_192] at java.net.SocketInputStream.socketRead(SocketInputStream.java:116) ~[?:1.8.0_192] at java.net.SocketInputStream.read(SocketInputStream.java:171) ~[?:1.8.0_192] at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:1.8.0_192] at java.io.BufferedInputStream.fill(BufferedInputStream.java:246) ~[?:1.8.0_192] at java.io.BufferedInputStream.read1(BufferedInputStream.java:286) ~[?:1.8.0_192] at java.io.BufferedInputStream.read(BufferedInputStream.java:345) ~[?:1.8.0_192] at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:735) ~[?:1.8.0_192] at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678) ~[?:1.8.0_192] at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587) ~[?:1.8.0_192] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492) ~[?:1.8.0_192] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[?:1.8.0_192] at org.glassfish.jersey.client.internal.HttpUrlConnector._apply(HttpUrlConnector.java:399) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.internal.HttpUrlConnector.apply(HttpUrlConnector.java:285) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:252) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:684) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:681) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.internal.Errors.process(Errors.java:315) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.internal.Errors.process(Errors.java:297) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.internal.Errors.process(Errors.java:228) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:444) ~[jersey-common-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:681) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:437) ~[jersey-client-2.25.1.jar:?] at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:343) ~[jersey-client-2.25.1.jar:?] at com.baidu.hugegraph.rest.RestClient.lambda$post$0(RestClient.java:116) ~[hugegraph-common-1.5.3.jar:1.5.3.0] 2019-04-19 13:43:33 17776634 [pool-3-thread-7] [ERROR] com.baidu.hugegraph.loader.util.LoaderUtil [] - Error: More than 500 edges insert error... Stopping 我想是因为导入的数量太大缘故吗?项目中有没有办法对数据导入上超过百亿条边对于这种错误上的处理方法。

charriyu avatar Apr 19 '19 06:04 charriyu

有两种方案降低超时的概率

  1. 调大服务端的batch.max_write_ratio=90,表示有2 * CPU核数 * 0.9 的线程可用于写数据;
  2. 增加loader端的请求超时时间,在命令行中添加--timeout = xxx,默认是60秒。

Linary avatar Apr 23 '19 10:04 Linary

Due to the lack of activity, the current issue is marked as stale and will be closed after 20 days, any update will remove the stale label

github-actions[bot] avatar Jan 01 '22 21:01 github-actions[bot]