Slackbot
10/18/2022, 11:21 PMSergio Ferragut
10/18/2022, 11:26 PMKai Sun
10/18/2022, 11:28 PMSergio Ferragut
10/18/2022, 11:34 PMSELECT count(*) for the same time interval and the number of rows returned to your result file? You might need to remove the "pretty" to get one row per line in your result.
Is this a clustered deployment, is that URL the broker? I'm just checking that you are not issuing the request to a historical in a cluster of multiple historicals.Kai Sun
10/18/2022, 11:38 PMKai Sun
10/18/2022, 11:39 PMGian Merlino
10/18/2022, 11:40 PMGian Merlino
10/18/2022, 11:41 PMGian Merlino
10/18/2022, 11:41 PMSergio Ferragut
10/18/2022, 11:45 PMKai Sun
10/18/2022, 11:46 PMKai Sun
10/18/2022, 11:48 PMKai Sun
10/18/2022, 11:50 PM}, {
"__time" : 1624925857991,
"dc" : "pzh",
"device" : "<http://stmfa1la2-lapp1-3-prd.eng.sfdc.net|stmfa1la2-lapp1-3-prd.eng.sfdc.net>",
"env" : "perf",
"eventType" : "transaction",
"name" : "xosvvrnw",
"orgId" : "org-hxpijeqprl",
"pod" : "pod-baz",
"superPod" : "superpod-pt",
"userId" : "04158427",
"sampled" : "false",
"serviceName" : "scrt",
"traceId" : "0000000000000000000000c08ca0c8ec",
"spanId" : "00004ada0c3f40e5",
"error" : "false",
"errorMessage" : "errMsg:-tlksffquufvfwzpftgytwswfyomcea",
"errorType" : "rmava",
"httpStatusCode" : "404",
"uri" : "/zyppowbiultrgdv",
"transactionType" : "hybernate",
"closed" : "true",
"closingTimestamp" : "1674363913877",
"dbCallCount" : 41962,
"duration" : 335132,
"dbCallDuration" : 8891576,
"externalCallCount" : 62862,
"externalCallDuration" : 4186772
}, {
"__time" : 1624925858001,
"dc" : "fqo",
"device" : "<http://stmfa1la2-lapp1-1-prd.eng.sfdc.net|stmfa1la2-lapp1-1-prd.eng.sfdc.net>",
"env" : "perf",
"eventType" : "transaction",
"name" : "upmaaiuc",
"orgId" : "org-xibawqscka",
"pod" : "pod-umq",
"superPod" : "superpod-vy",
"userId" : "%Kai Sun
10/18/2022, 11:51 PMJust making sure,... the "size" column in the result you are showing is the size in bytes of the segment partition, does the num_rows column in that result have the numbers you expect?No, it does not have the number of lines I expect. Way lower
Kai Sun
10/18/2022, 11:51 PMSergio Ferragut
10/18/2022, 11:58 PMKai Sun
10/19/2022, 12:00 AMdruid.server.http.defaultQueryTimeout is set as druid.server.http.defaultQueryTimeout=600000Kai Sun
10/19/2022, 12:01 AMKai Sun
10/19/2022, 12:06 AM2022-10-19T00:05:29,867 ERROR [qtp1727196188-246] org.apache.druid.server.QueryResource - Unable to send query response. (com.fasterxml.jackson.databind.JsonMappingException: Query[0b6845d6-714b-46ff-a495-bb4bef152d74] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected])
2022-10-19T00:05:29,868 WARN [qtp1727196188-246] org.apache.druid.server.QueryLifecycle - Exception while processing queryId [0b6845d6-714b-46ff-a495-bb4bef152d74] (com.fasterxml.jackson.databind.JsonMappingException: Query[0b6845d6-714b-46ff-a495-bb4bef152d74] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected])
2022-10-19T00:05:29,869 WARN [qtp1727196188-246] org.eclipse.jetty.server.HttpChannel - handleException /druid/v2/ com.fasterxml.jackson.databind.JsonMappingException: Query[0b6845d6-714b-46ff-a495-bb4bef152d74] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected]Kai Sun
10/19/2022, 12:09 AM2022-10-19T00:05:28,864 ERROR [qtp2085313771-134[scan_[perf_data_1T_1]_0b6845d6-714b-46ff-a495-bb4bef152d74]] org.apache.druid.server.QueryResource - Unable to send query response. (org.eclipse.jetty.io.EofException)
2022-10-19T00:05:28,864 WARN [qtp2085313771-134] org.apache.druid.server.QueryLifecycle - Exception while processing queryId [0b6845d6-714b-46ff-a495-bb4bef152d74] (org.eclipse.jetty.io.EofException)Kai Sun
10/19/2022, 12:13 AMSergio Ferragut
10/19/2022, 12:13 AMKai Sun
10/19/2022, 12:14 AMKai Sun
10/19/2022, 12:14 AM2022-10-19T00:05:30,959 ERROR [qtp774840504-131] org.apache.druid.server.AsyncQueryForwardingServlet - Exception handling request: {class=org.apache.druid.server.AsyncQueryForwardingServlet, exceptionType=class java.io.EOFException, exceptionMessage=HttpConnectionOverHTTP@698f503a::SocketChannelEndPoint@1c4942b6{l=/10.64.196.185:49932,r=/10.64.196.217:8088,ISHUT,fill=-,flush=-,to=0/900000}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@698f503a(l:/10.64.196.185:49932 <-> r:/10.64.196.217:8088,closed=false)=>HttpChannelOverHTTP@11826201(exchange=HttpExchange@4d81d165{req=HttpRequest[POST /druid/v2/ HTTP/1.1]@5e9c566f[TERMINATED/null] res=HttpResponse[HTTP/1.1 200 OK]@896f3f8[PENDING/null]})[send=HttpSenderOverHTTP@a860a81(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@49cfe84d{s=START}],recv=HttpReceiverOverHTTP@755cf035(rsp=CONTENT,failure=null)[HttpParser{s=CLOSED,78527284 of -1}]], exception=java.io.EOFException: HttpConnectionOverHTTP@698f503a::SocketChannelEndPoint@1c4942b6{l=/10.64.196.185:49932,r=/10.64.196.217:8088,ISHUT,fill=-,flush=-,to=0/900000}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@698f503a(l:/10.64.196.185:49932 <-> r:/10.64.196.217:8088,closed=false)=>HttpChannelOverHTTP@11826201(exchange=HttpExchange@4d81d165{req=HttpRequest[POST /druid/v2/ HTTP/1.1]@5e9c566f[TERMINATED/null] res=HttpResponse[HTTP/1.1 200 OK]@896f3f8[PENDING/null]})[send=HttpSenderOverHTTP@a860a81(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@49cfe84d{s=START}],recv=HttpReceiverOverHTTP@755cf035(rsp=CONTENT,failure=null)[HttpParser{s=CLOSED,78527284 of -1}]], query=ScanQuery{dataSource='perf_data_1T_1', querySegmentSpec=LegacySegmentSpec{intervals=[2021-06-29T00:00:00.000Z/2021-06-30T00:00:00.000Z]}, virtualColumns=[], resultFormat='list', batchSize=20480, offset=0, limit=9223372036854775807, dimFilter=null, columns=[], context={queryId=0b6845d6-714b-46ff-a495-bb4bef152d74}}, peer=127.0.0.1}
java.io.EOFException: HttpConnectionOverHTTP@698f503a::SocketChannelEndPoint@1c4942b6{l=/10.64.196.185:49932,r=/10.64.196.217:8088,ISHUT,fill=-,flush=-,to=0/900000}{io=0/0,kio=0,kro=1}->HttpConnectionOverHTTP@698f503a(l:/10.64.196.185:49932 <-> r:/10.64.196.217:8088,closed=false)=>HttpChannelOverHTTP@11826201(exchange=HttpExchange@4d81d165{req=HttpRequest[POST /druid/v2/ HTTP/1.1]@5e9c566f[TERMINATED/null] res=HttpResponse[HTTP/1.1 200 OK]@896f3f8[PENDING/null]})[send=HttpSenderOverHTTP@a860a81(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator@49cfe84d{s=START}],recv=HttpReceiverOverHTTP@755cf035(rsp=CONTENT,failure=null)[HttpParser{s=CLOSED,78527284 of -1}]]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:385) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1620) ~[jetty-http-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:269) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:185) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:80) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.HttpReceiver.demand(HttpReceiver.java:118) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.HttpReceiver$ContentListeners.demand(HttpReceiver.java:701) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.ResponseNotifier.lambda$notifyContent$1(ResponseNotifier.java:139) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.client.api.Response$AsyncContentListener.lambda$onContent$0(Response.java:192) ~[jetty-client-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.util.Callback$3.succeeded(Callback.java:142) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.util.Callback$Nested.succeeded(Callback.java:285) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.proxy.AsyncProxyServlet$StreamWriter.complete(AsyncProxyServlet.java:284) [jetty-proxy-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.proxy.AsyncProxyServlet$StreamWriter.onWritePossible(AsyncProxyServlet.java:265) [jetty-proxy-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.server.HttpOutput.run(HttpOutput.java:1541) [jetty-server-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1525) [jetty-server-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:600) [jetty-server-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:439) [jetty-server-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]Kai Sun
10/19/2022, 12:16 AMDo you see a TimeoutException in the Historical log?Do you have some string to search? In fact, I don't think so. Because I tried it one more time and there is the single historical. I did wait for the error message with a
tail -f and the above are the only ones.Sergio Ferragut
10/19/2022, 12:20 AMdruid.server.http.maxIdleTime is 5 minutes, so that's not it either.Sergio Ferragut
10/19/2022, 12:21 AMKai Sun
10/19/2022, 12:23 AMKai Sun
10/19/2022, 12:23 AMKai Sun
10/19/2022, 12:23 AMSergio Ferragut
10/19/2022, 12:26 AMKai Sun
10/19/2022, 12:33 AMSergio Ferragut
10/19/2022, 12:37 AMKai Sun
10/19/2022, 12:38 AM2022-10-19T00:05:29,867 ERROR [qtp1727196188-246] org.apache.druid.server.QueryResource - Unable to send query response. (com.fasterxml.jackson.databind.JsonMappingException: Query[0b6845d6-714b-46ff-a495-bb4bef152d74] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected])
Basically Broker complains it can't send query response to router due to <http://10.64.210.125:8088/druid/v2/> end point failed? And subsequent router exception is due to broker close the connection/ sending error to the router?Kai Sun
10/19/2022, 12:39 AMWere you able to do this scan query before?This is for perf test. We did do quite some query before, but not this large scale scans.
Sergio Ferragut
10/19/2022, 12:57 AMUnable to send query response. (org.eclipse.jetty.io.EofException)
The broker then errors out right after that with a
Query[0b6845d6-714b-46ff-a495-bb4bef152d74] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected]
I think the router error is just a side effect. You can prove this by submitting the request directly to the broker.
But we still don't know why the connection is being lost between historical and broker.Kai Sun
10/19/2022, 1:11 AMKai Sun
10/19/2022, 1:11 AMSergio Ferragut
10/19/2022, 2:30 AMdruid.server.http.defaultQueryTimeout . Is it maybe lower on the brokers?Kai Sun
10/19/2022, 2:41 AMdruid.server.http.defaultQueryTimeout=600000Kai Sun
10/19/2022, 2:43 AMjava.util.concurrent.TimeoutException: Idle timeout expired: in the historical log. And in my case, there is no such log.Kai Sun
10/19/2022, 2:45 AMEofException
2022-10-19T00:05:28,864 ERROR [qtp2085313771-134[scan_[perf_data_1T_1]_0b6845d6-714b-46ff-a495-bb4bef152d74]] org.apache.druid.server.QueryResource - Unable to send query response. (org.eclipse.jetty.io.EofException)
EofException means end of file, right? It is likely that the broker side closed the socket somehow?Gian Merlino
10/19/2022, 7:15 AMGian Merlino
10/19/2022, 7:16 AMGian Merlino
10/19/2022, 7:16 AMGian Merlino
10/19/2022, 7:16 AMKai Sun
10/19/2022, 5:52 PMIf you do have one -- try contacting the Broker directly@Gian Merlino, Can you illustrated a little bit what you want to try by contacting broker directly? Here, I deployed all the servers in k8. I did try using port forwarding to issue the query against broker and historical respectively. Trying historical individually has not such EOF exception. While trying broker with this query, it still terminate at 22 seconds.
Gian Merlino
10/19/2022, 5:54 PMGian Merlino
10/19/2022, 5:54 PMGian Merlino
10/19/2022, 5:55 PMlocalhostGian Merlino
10/19/2022, 5:55 PMKai Sun
10/19/2022, 6:01 PMKai Sun
10/19/2022, 6:42 PMbash-4.2$ curl -X POST '<http://127.0.0.1:8088/druid/v2/?pretty>' -H 'Content-Type:application/json' -d @tst.json > his.out
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 491M 0 491M 100 157 30.7M 9 0:00:17 0:00:16 0:00:01 34.4M
Basically, at 17 secs, the network connection would terminate. And the result is partial result.
bash-4.2$ head his.out
[ {
"segmentId" : "perf_data_1T_1_2021-06-28T00:00:00.000Z_2021-06-29T00:00:00.000Z_2022-10-14T21:45:47.249Z",
"columns" : [ "__time", "dc", "device", "env", "eventType", "name", "orgId", "pod", "superPod", "userId", "sampled", "serviceName", "traceId", "spanId", "error", "errorMessage", "errorType", "httpStatusCode", "uri", "transactionType", "closed", "closingTimestamp", "dbCallCount", "duration", "dbCallDuration", "externalCallCount", "externalCallDuration" ],
"events" : [ {
"__time" : 1624838400001,
"dc" : "ifc",
"device" : "<http://istla4la2-lapp1-4-prd.eng.sfdc.net|istla4la2-lapp1-4-prd.eng.sfdc.net>",
"env" : "test",
"eventType" : "transaction",
"name" : "rqrxxpqj",
bash-4.2$ vim his.out
bash: vim: command not found
bash-4.2$ vi his.out
[1]+ Stopped vi his.out
bash-4.2$ fg
vi his.out
bash-4.2$ tail his.out
"transactionType" : "hybernate",
"closed" : "false",
"closingTimestamp" : "1722314312545",
"dbCallCount" : 23803,
"duration" : 532518,
"dbCallDuration" : 8444575,
"externalCallCount" : 59096,
"externalCallDuration" : 4503417
} ]
}Sergio Ferragut
10/19/2022, 6:55 PMKai Sun
10/19/2022, 6:56 PM]. Also, let me post the error logs, this time, a little bit more from historical side.Kai Sun
10/19/2022, 7:00 PM2022-10-19T18:51:41,474 WARN [qtp1727196188-205] org.apache.druid.client.JsonParserIterator - Query [b6759bd2-1936-4efa-acef-ee26c651eeaf] to host [10.64.210.125:8088] interrupted
java.io.IOException: Query[b6759bd2-1936-4efa-acef-ee26c651eeaf] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected]
at org.apache.druid.client.DirectDruidClient$1$3.read(DirectDruidClient.java:408) ~[druid-server-0.23.0-sfmc.jar:0.23.0-sfmc]
at java.io.InputStream.read(InputStream.java:170) ~[?:1.8.0_162]
at java.io.SequenceInputStream.read(SequenceInputStream.java:207) ~[?:1.8.0_162]
at com.fasterxml.jackson.dataformat.smile.SmileParser._loadToHaveAtLeast(SmileParser.java:289) ~[jackson-dataformat-smile-2.10.5.jar:2.10.5]
at com.fasterxml.jackson.dataformat.smile.SmileParser._decodeShortAsciiValue(SmileParser.java:2223) ~[jackson-dataformat-smile-2.10.5.jar:2.10.5]
at com.fasterxml.jackson.dataformat.smile.SmileParser.getText(SmileParser.java:996) ~[jackson-dataformat-smile-2.10.5.jar:2.10.5]
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:672) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.mapObject(UntypedObjectDeserializer.java:895) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:654) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.mapArray(UntypedObjectDeserializer.java:831) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializer$Vanilla.deserialize(UntypedObjectDeserializer.java:668) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:530) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeWithErrorWrapping(BeanDeserializer.java:528) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:417) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1292) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:326) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:159) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4189) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2525) ~[jackson-databind-2.10.5.1.jar:2.10.5.1]
at org.apache.druid.client.JsonParserIterator.next(JsonParserIterator.java:112) ~[druid-server-0.23.0-sfmc.jar:0.23.0-sfmc]
at org.apache.druid.java.util.common.guava.BaseSequence.makeYielder(BaseSequence.java:90) ~[druid-core-0.23.0-sfmc.jar:0.23.0-sfmc]
at org.apache.druid.java.util.common.guava.BaseSequence.access$000(BaseSequence.java:27) ~[druid-core-0.23.0-sfmc.jar:0.23.0-sfmc]
at org.apache.druid.java.util.common.guava.BaseSequence$1.next(BaseSequence.java:114) ~[druid-core-0.23.0-sfmc.jar:0.23.0-sfmc]
at org.apache.druid.java.util.common.guava.MergeSequence.makeYielder(MergeSequence.java:132) ~[druid-core-0.23.0-sfmc.jar:0.23.0-sfmc]
...
at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [jetty-util-9.4.47.v20220610.jar:9.4.47.v20220610]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
Caused by: org.jboss.netty.channel.ChannelException: Channel disconnected
at org.apache.druid.java.util.http.client.NettyHttpClient$1.channelDisconnected(NettyHttpClient.java:345) ~[druid-core-0.23.0-sfmc.jar:0.23.0-sfmc]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.channelDisconnected(SimpleChannelUpstreamHandler.java:208) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.channelDisconnected(SimpleChannelUpstreamHandler.java:208) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.handler.codec.replay.ReplayingDecoder.cleanup(ReplayingDecoder.java:570) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.handler.codec.frame.FrameDecoder.channelDisconnected(FrameDecoder.java:365) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream(HttpClientCodec.java:92) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.Channels.fireChannelDisconnected(Channels.java:396) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:360) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:93) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) ~[netty-3.10.6.Final.jar:?]
at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) ~[netty-3.10.6.Final.jar:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_162]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_162]
... 1 more
2022-10-19T18:51:41,476 ERROR [qtp1727196188-205] org.apache.druid.server.QueryResource - Unable to send query response. (com.fasterxml.jackson.databind.JsonMappingException: Query[b6759bd2-1936-4efa-acef-ee26c651eeaf] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected])
2022-10-19T18:51:41,477 WARN [qtp1727196188-205] org.apache.druid.server.QueryLifecycle - Exception while processing queryId [b6759bd2-1936-4efa-acef-ee26c651eeaf] (com.fasterxml.jackson.databind.JsonMappingException: Query[b6759bd2-1936-4efa-acef-ee26c651eeaf] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected])
2022-10-19T18:51:41,477 WARN [qtp1727196188-205] org.eclipse.jetty.server.HttpChannel - handleException /druid/v2/ com.fasterxml.jackson.databind.JsonMappingException: Query[b6759bd2-1936-4efa-acef-ee26c651eeaf] url[<http://10.64.210.125:8088/druid/v2/>] failed with exception msg [Channel disconnected]Kai Sun
10/19/2022, 7:00 PMKai Sun
10/19/2022, 7:03 PM2022-10-19T18:51:40,471 ERROR [qtp2085313771-179[scan_[perf_data_1T_1]_b6759bd2-1936-4efa-acef-ee26c651eeaf]] org.apache.druid.server.QueryResource - Unable to send query response. (org.eclipse.jetty.io.EofException)
2022-10-19T18:51:40,472 WARN [qtp2085313771-179] org.apache.druid.server.QueryLifecycle - Exception while processing queryId [b6759bd2-1936-4efa-acef-ee26c651eeaf] (org.eclipse.jetty.io.EofException)Kai Sun
10/19/2022, 7:20 PM2022-10-19T19:19:36,275 ERROR [qtp2085313771-120[scan_[perf_data_1T_1]_40b50275-9167-475a-82a9-e185f9f261d2]] org.apache.druid.server.QueryResource - Unable to send query response. (com.fasterxml.jackson.databind.JsonM
appingException: Query [40b50275-9167-475a-82a9-e185f9f261d2] timed out)
2022-10-19T19:19:36,275 WARN [qtp2085313771-120] org.apache.druid.server.QueryLifecycle - Exception while processing queryId [40b50275-9167-475a-82a9-e185f9f261d2] (com.fasterxml.jackson.databind.JsonMappingException:
Query [40b50275-9167-475a-82a9-e185f9f261d2] timed out)
2022-10-19T19:19:36,275 WARN [qtp2085313771-120] org.eclipse.jetty.server.HttpChannel - handleException /druid/v2/ com.fasterxml.jackson.databind.JsonMappingException: Query [40b50275-9167-475a-82a9-e185f9f261d2] timed
out
And the query is:
bash-4.2$ date; curl -X POST '<http://127.0.0.1:8088/druid/v2/?pretty>' -H 'Content-Type:application/json' -d @scan.json > his.out
Wed Oct 19 19:16:59 GMT 2022
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11.3G 0 11.3G 100 157 74.2M 1 0:02:37 0:02:36 0:00:01 78.0MSergio Ferragut
10/19/2022, 7:55 PMKai Sun
10/19/2022, 7:58 PMKai Sun
10/19/2022, 7:59 PMtimed out is different. We can search the code to have some clue.
2022-10-19T19:19:36,275 ERROR [qtp2085313771-120[scan_[perf_data_1T_1]_40b50275-9167-475a-82a9-e185f9f261d2]] org.apache.druid.server.QueryResource - Unable to send query response. (com.fasterxml.jackson.databind.JsonM
appingException: Query [40b50275-9167-475a-82a9-e185f9f261d2] timed out)Kai Sun
10/19/2022, 8:09 PMlog.noStackTrace().error(ex, "Unable to send query response.");
Response.ResponseBuilder responseBuilder = Response
.ok(
new StreamingOutput()
{
@Override
public void write(OutputStream outputStream) throws WebApplicationException
{
Exception e = null;
CountingOutputStream os = new CountingOutputStream(outputStream);
try {
// json serializer will always close the yielder
jsonWriter.writeValue(os, yielder);
os.flush(); // Some types of OutputStream suppress flush errors in the .close() method.
os.close();
}
catch (Exception ex) {
e = ex;
log.noStackTrace().error(ex, "Unable to send query response.");
throw new RuntimeException(ex);
}
finally {
Thread.currentThread().setName(currThreadName);
queryLifecycle.emitLogsAndMetrics(e, req.getRemoteAddr(), os.getCount());Sergio Ferragut
10/19/2022, 9:13 PMat org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:360)
https://github.com/netty/netty/blob/5f56a03bcb0aa23bdc9f68686e5c2abcf963a9cd/src/main/java/org/jboss/netty/channel/socket/nio/AbstractNioWorker.java#L360
so, I'm still thinking network problem.Kai Sun
10/19/2022, 9:28 PMSergio Ferragut
10/19/2022, 9:38 PMKai Sun
10/19/2022, 9:49 PMjsonWriter.writeValue(os, yielder); knows how to serialize a Sequence Yielder.
public DefaultObjectMapper(JsonFactory factory)
{
super(factory);
registerModule(new DruidDefaultSerializersModule());
registerModule(new GuavaModule());
registerModule(new GranularityModule());
registerModule(new AggregatorsModule());
Note, here it is registering Jackson module, not Guice module.
2/ DruidDefaultSerializersModule we have how to serialize a Yielder (sequence's yielder), which basically yield one object at a time, and call jgen.writeObject(o)
addSerializer(
Yielder.class,
new JsonSerializer<Yielder>()
{
@Override
public void serialize(Yielder yielder, final JsonGenerator jgen, SerializerProvider provider)
throws IOException
{
try {
jgen.writeStartArray();
while (!yielder.isDone()) {
final Object o = yielder.get();
jgen.writeObject(o);
yielder = yielder.next(null);
}
jgen.writeEndArray();
}
finally {
yielder.close();
}
}
}
);
3/ In the QueryResource code to build response
try {
// json serializer will always close the yielder
jsonWriter.writeValue(os, yielder);
os.flush(); // Some types of OutputStream suppress flush errors in the .close() method.
os.close();
}
catch (Exception ex) {
e = ex;
log.noStackTrace().error(ex, "Unable to send query response.");
throw new RuntimeException(ex);
}
Here, jsonWriter actually wraps a DefaultObjectMapper above to write yielders. Note, this is a streaming operation. One the main reason to use Yielder/Sequence (not common pattern) is to stream the data while doing some business logic processing. And here, the ex has the following message `
(com.fasterxml.jackson.databind.JsonM
appingException: Query [40b50275-9167-475a-82a9-e185f9f261d2] timed out)
This ex is thrown out from the above serialization code
jgen.writeStartArray();
while (!yielder.isDone()) {
final Object o = yielder.get();
jgen.writeObject(o);
yielder = yielder.next(null);
}
jgen.writeEndArray();
Note, this san test is from historical. So this yielder is not really get data from another server via network socket. Instead, it is getting the data from the local disk. So I think the timeout it complains is with some disk/cache/mmaped segment file etc.Kai Sun
10/19/2022, 9:56 PMSergio Ferragut
10/19/2022, 10:02 PMKai Sun
10/19/2022, 10:22 PMlog.noStackTrace().error(ex, "Unable to send query response."); which give timeout is from the ex exception, whose stack trace was not logged. However, we can still find out where in the code it may be logged out. The current intellij has an older copy of code that I did not find the exact pattern of Query [40b50275-9167-475a-82a9-e185f9f261d2] timed out. However, from latest code repo here, I did find out several having this pattern. And this one, https://github.com/apache/druid/blob/c83115e4e19a5825413c09566d165aa142a712a7/proc[…]/src/main/java/org/apache/druid/query/scan/ScanQueryEngine.java seem to be the line emitting the Query xxxxx timed out exception when serialization of json response.Kai Sun
10/19/2022, 10:25 PMfinal boolean hasTimeout = query.context().hasTimeout();
final Long timeoutAt = responseContext.getTimeoutTime();Kai Sun
10/19/2022, 10:26 PMSergio Ferragut
10/19/2022, 10:32 PMSergio Ferragut
10/19/2022, 10:33 PMKai Sun
10/19/2022, 10:34 PMKai Sun
10/19/2022, 10:36 PMSergio Ferragut
10/19/2022, 10:37 PMKai Sun
10/19/2022, 10:38 PMKai Sun
10/20/2022, 12:12 AMSergio Ferragut
10/20/2022, 3:18 PMSergio Ferragut
10/20/2022, 3:24 PMKai Sun
10/20/2022, 6:34 PMSergio Ferragut
10/20/2022, 6:36 PMGian Merlino
10/21/2022, 4:31 AM