Skip to content
Snippets Groups Projects
Unverified Commit 18e669c0 authored by metamben's avatar metamben Committed by GitHub
Browse files

Convey cancelation info when the client closes the connection (#47740)

Fixes #4755
parent 41b4b687
No related branches found
No related tags found
No related merge requests found
......@@ -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.")
......
......@@ -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 50ms, up to 1000ms, whether `canceled?` is now `true`
;; check every 10ms, 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)
......
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