Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
15747fad
Unverified
Commit
15747fad
authored
5 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
Fix too much logging on query cancelation
parent
9c76df43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/metabase/async/api_response.clj
+1
-1
1 addition, 1 deletion
src/metabase/async/api_response.clj
src/metabase/driver/sql_jdbc/execute.clj
+1
-1
1 addition, 1 deletion
src/metabase/driver/sql_jdbc/execute.clj
src/metabase/query_processor.clj
+5
-5
5 additions, 5 deletions
src/metabase/query_processor.clj
with
7 additions
and
7 deletions
src/metabase/async/api_response.clj
+
1
−
1
View file @
15747fad
...
...
@@ -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"
))
...
...
This diff is collapsed.
Click to expand it.
src/metabase/driver/sql_jdbc/execute.clj
+
1
−
1
View file @
15747fad
...
...
@@ -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, cancel
l
ing 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
)
...
...
This diff is collapsed.
Click to expand it.
src/metabase/query_processor.clj
+
5
−
5
View file @
15747fad
...
...
@@ -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
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment