-
Notifications
You must be signed in to change notification settings - Fork 110
Fix dropped errors in manifold.go-off
#249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: fix-dropped-errors-in-timeout
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,8 +46,7 @@ | |
(defn ^:no-doc run-state-machine-wrapped [state] | ||
(try (async-runtime/run-state-machine state) | ||
(catch Throwable ex | ||
(d/error! (async-runtime/aget-object state async-runtime/USER-START-IDX) ex) | ||
(throw ex)))) | ||
(d/error! (async-runtime/aget-object state async-runtime/USER-START-IDX) ex)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't used this code in years, can't say I remember why we were re-throwing the original error There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for your reply! Alright, I'll try to get to the bottom of this myself then 💪 |
||
|
||
(defn ^:no-doc take! [state blk d] | ||
(let [handler (fn [x] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,12 +115,12 @@ | |
(testing "timeouts" | ||
(is (= ::timeout @(go-off (<!? (d/timeout! (d/deferred) 10 ::timeout))))) | ||
(is (= ::timeout @(d/timeout! (go-off (<!? (d/deferred))) 10 ::timeout))) | ||
(is (thrown? TimeoutException @(go-off (<!? (d/timeout! (d/deferred) 10))))) | ||
(is (thrown? TimeoutException @(d/timeout! (go-off (<!? (d/deferred))) 10)))) | ||
(is (thrown? TimeoutException @(go-off (<!? (d/timeout! (d/deferred) 11))))) | ||
(is (thrown? TimeoutException @(d/timeout! (go-off (<!? (d/deferred))) 12)))) | ||
|
||
(testing "alt" | ||
(is (= ::timeout @(go-off (<!? (d/alt (d/deferred) (d/timeout! (d/deferred) 10 ::timeout)))))) | ||
(is (= ::timeout @(d/alt (go-off (<!? (d/deferred))) (d/timeout! (d/deferred) 10 ::timeout)))) | ||
(is (= ::timeout @(go-off (<!? (d/alt (d/deferred) (d/timeout! (d/deferred) 13 ::timeout)))))) | ||
(is (= ::timeout @(d/alt (go-off (<!? (d/deferred))) (d/timeout! (d/deferred) 14 ::timeout)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this change necessary? |
||
(is (= 1 @(go-off (<!? (d/alt (d/deferred) (d/success-deferred 1)))))) | ||
(is (= 1 @(d/alt (go-off (<!? (d/deferred))) (d/success-deferred 1)))))) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this rethrow the core of the issue?
since you're catching the extremely wide Throwable it'd feel safer to keep the rethrow unless that's what's causing the problem