Skip to content

Conversation

DerGuteMoritz
Copy link
Collaborator

Timeout tests are changed so that every timeout exception has a uniquely identifiable message which makes it easier to match up the dropped error warning with the originating timeout.

Based on #248. Fixes the remaining dropped error failure in manifold.go-off-test.

@tanzoniteblack Sine you're the original author of manifold.go-off, maybe you could review this one? 🙏 I'm not quite sure whether not re-throwing the exception here breaks anything else, and if it should, maybe you could provide a test case? It definitely does lead to an unhandled deferred in error state, though, as evidenced by the test failure without the patch. However, I don't even grok which deferred that is 😅

Timeout tests are changed so that every timeout exception has a uniquely identifiable message which
makes it easier to match up the dropped error warning with the originating timeout.
(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))))
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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 💪

(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))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change necessary?

(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))))
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants