Skip to content

Make getResult methods to throw TimeoutException instead of raw gRPC DEADLINE_EXCEEDED #1209

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
May 16, 2022

Conversation

Spikhalskiy
Copy link
Contributor

@Spikhalskiy Spikhalskiy commented May 12, 2022

What was changed

Make getResult methods to throw TimeoutException as the method contract states instead of raw gRPC DEADLINE_EXCEEDED.
getResultAsync now respects the timeout.
Unit tests are added that are covering different kinds of timeouts and retries of the long poll.

Closes #1177
Closes #988
Closes #1203

@Spikhalskiy Spikhalskiy force-pushed the issue-1177 branch 3 times, most recently from a67716e to 40685f8 Compare May 12, 2022 22:48
@Spikhalskiy Spikhalskiy force-pushed the issue-1177 branch 5 times, most recently from 8ae4a9d to dde1bdc Compare May 13, 2022 00:33
@Spikhalskiy Spikhalskiy marked this pull request as ready for review May 13, 2022 00:37

/**
* These tests are intentionally running longer than a minute to cover a situation when getResult
* calls needs to survive a server timeout on a long poll of 60 seconds to get the result of
Copy link
Member

Choose a reason for hiding this comment

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

Any reason not to just crank down the poll timeout a bit?

Copy link
Contributor Author

@Spikhalskiy Spikhalskiy May 13, 2022

Choose a reason for hiding this comment

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

I want to test a situation when the server responds with an empty result, not when we hit a long poll timeout. And for that, I have to get over 20 seconds (this is the default behavior right now, the server cuts history long polls in 20 seconds and returns an empty history). Or modify the settings of our server, which I don't want to abuse.

@Spikhalskiy Spikhalskiy force-pushed the issue-1177 branch 5 times, most recently from a8f0a33 to 822a8e5 Compare May 14, 2022 00:25
…DEADLINE_EXCEEDED

getResultAsync now respects the timeout

Issue temporalio#1177
Issue temporalio#988
@Spikhalskiy Spikhalskiy force-pushed the issue-1177 branch 3 times, most recently from d4bdf45 to 986329d Compare May 14, 2022 01:53
…DEADLINE_EXCEEDED

getResultAsync now respects the timeout

Issue temporalio#1177
Issue temporalio#988
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants