trinodb / trino

Official repository of Trino, the distributed SQL query engine for big data, formerly known as PrestoSQL (https://trino.io)
https://trino.io
Apache License 2.0
10.48k stars 3.02k forks source link

Query result status to the client is 404 #17646

Open Larrygit opened 1 year ago

Larrygit commented 1 year ago

The query seems to have been executed successfully, but the returned result status to the client is 404。

client log

Caused by: java.lang.RuntimeException: Error fetching next at http:/xxx/v1/statement/executing/20230525_223224_62585_4y2a9/y5dbc8679a4e0de370dcc85f2813436fa8a1c5642/2 returned an invalid response: JsonResponse{statusCode=404, headers={content-length=[15], content-type=[text/plain], date=[Thu, 25 May 2023 22:32:24 GMT]}, hasValue=false} [Error: Query not found]
    at io.trino.jdbc.$internal.client.StatementClientV1.requestFailedException(StatementClientV1.java:457)
    at io.trino.jdbc.$internal.client.StatementClientV1.advance(StatementClientV1.java:396)
    at io.trino.jdbc.TrinoResultSet$ResultsPageIterator.computeNext(TrinoResultSet.java:279)
    at io.trino.jdbc.TrinoResultSet$ResultsPageIterator.computeNext(TrinoResultSet.java:255)
    at io.trino.jdbc.$internal.guava.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:146)
    at io.trino.jdbc.$internal.guava.collect.AbstractIterator.hasNext(AbstractIterator.java:141)
    at java.util.Spliterators$IteratorSpliterator.tryAdvance(Spliterators.java:1811)
    at java.util.stream.StreamSpliterators$WrappingSpliterator.lambda$initPartialTraversalState$0(StreamSpliterators.java:294)
    at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.fillBuffer(StreamSpliterators.java:206)
    at java.util.stream.StreamSpliterators$AbstractWrappingSpliterator.doAdvance(StreamSpliterators.java:161)
    at java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
    at java.util.Spliterators$1Adapter.hasNext(Spliterators.java:681)
    at io.trino.jdbc.TrinoResultSet$AsyncIterator.lambda$new$1(TrinoResultSet.java:180)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    ... 1 common frames omitted

server.log

2023-05-26T06:32:24.500+0800    INFO    dispatcher-query-935    io.trino.event.QueryMonitor     TIMELINE: Query 20230525_223224_62585_4y2a9 :: FINISHED :: elapsed 152ms :: planning 4ms :: waiting 0ms :: scheduling 6ms :: running 6ms :: finishing 136ms :: begin 2023-05-26T06:32:24.346+08:00 :: end 2023-05-26T06:32:24.498+08:00

2023-05-26T06:47:25.157+0800    WARN    execution-query-purger  io.trino.server.protocol.ExecutingStatementResource     Error marking results consumed
java.util.NoSuchElementException: 20230525_223224_62585_4y2a9
        at io.trino.execution.QueryTracker.lambda$getQuery$1(QueryTracker.java:147)
        at java.base/java.util.Optional.orElseThrow(Optional.java:403)
        at io.trino.execution.QueryTracker.getQuery(QueryTracker.java:147)
        at io.trino.execution.SqlQueryManager.resultsConsumed(SqlQueryManager.java:167)
        at io.trino.server.protocol.Query.markResultsConsumedIfReady(Query.java:354)
        at io.trino.server.protocol.ExecutingStatementResource.lambda$new$0(ExecutingStatementResource.java:141)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:833)
Allupeng commented 1 year ago

i have same problem, do u solve this ?

molschimke2 commented 1 year ago

Same problem here. Long running query