Skip to content
Snippets Groups Projects
Unverified Commit 15747fad authored by Cam Saul's avatar Cam Saul
Browse files

Fix too much logging on query cancelation :wrench:

parent 9c76df43
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@
(.flush out)
true
(catch EofException e
(log/debug e (u/format-color 'yellow (trs "connection closed, canceling request")))
(log/debug (u/format-color 'yellow (trs "connection closed, canceling request")))
false)
(catch Throwable e
(log/error e (trs "Unexpected error writing keepalive characters"))
......
......@@ -181,7 +181,7 @@
;; we can give up on the query running in the future
@query-future)
(catch InterruptedException e
(log/warn e (tru "Client closed connection, cancelling query"))
(log/warn (tru "Client closed connection, canceling query"))
;; This is what does the real work of canceling the query. We aren't checking the result of
;; `query-future` but this will cause an exception to be thrown, saying the query has been cancelled.
(.cancel stmt)
......
......@@ -300,7 +300,10 @@
(throw (ex-info (str (tru "Invalid response from database driver. No :status provided."))
query-result)))
(when (= :failed (:status query-result))
(log/warn (u/pprint-to-str 'red query-result))
(if (= InterruptedException (:class query-result))
(log/info (trs "Query canceled"))
(log/warn (trs "Query failure")
(u/pprint-to-str 'red query-result)))
(throw (ex-info (str (get query-result :error (tru "General error")))
query-result))))
......@@ -341,11 +344,8 @@
(let [result (process-query query)]
(assert-query-status-successful result)
(save-and-return-successful-query! query-execution result))
;; canceled query
(catch Throwable e
(log/warn (u/format-color 'red (trs "Query failure")
(.getMessage e)
"\n"
(u/pprint-to-str (u/filtered-stacktrace e))))
(save-and-return-failed-query! query-execution e)))))
(s/defn ^:private assoc-query-info [query, options :- mbql.s/Info]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment