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
18e669c0
Unverified
Commit
18e669c0
authored
6 months ago
by
metamben
Committed by
GitHub
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Convey cancelation info when the client closes the connection (#47740)
Fixes #4755
parent
41b4b687
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/query_processor/streaming.clj
+2
-1
2 additions, 1 deletion
src/metabase/query_processor/streaming.clj
test/metabase/async/streaming_response_test.clj
+3
-4
3 additions, 4 deletions
test/metabase/async/streaming_response_test.clj
with
5 additions
and
5 deletions
src/metabase/query_processor/streaming.clj
+
2
−
1
View file @
18e669c0
...
...
@@ -172,7 +172,8 @@
export-format
os
(
^
:once
fn*
[
rff
]
(
let
[
result
(
try
(
f
rff
)
(
binding
[
qp.pipeline/*canceled-chan*
canceled-chan
]
(
f
rff
))
(
catch
Throwable
e
e
))]
(
assert
(
some?
result
)
"QP unexpectedly returned nil."
)
...
...
This diff is collapsed.
Click to expand it.
test/metabase/async/streaming_response_test.clj
+
3
−
4
View file @
18e669c0
...
...
@@ -143,14 +143,13 @@
;; wait a little while for the query to start running -- this should usually happen fairly quickly
(
mt/wait-for-result
start-chan
(
u/seconds->ms
15
))
(
future-cancel
futur
)
;; check every
5
0ms, up to 1000ms, whether `canceled?` is now `true`
;; check every
1
0ms, up to 1000ms, whether `canceled?` is now `true`
(
is
(
loop
[[
wait
&
more
]
(
repeat
10
100
)]
(
or
@
canceled?
(
if
wait
(
when
wait
(
do
(
Thread/sleep
(
long
wait
))
(
recur
more
))
::timed-out
)))))))))))
(
recur
more
)))))))))))))
(
def
^
:private
^
:dynamic
*number-of-cans*
nil
)
...
...
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