-
Notifications
You must be signed in to change notification settings - Fork 61
Progressive callees deadlock when handler returns error while caller IsInProgress #319
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
Comments
Curious if anyone could chime in on what the best or most correct way to fix this is. The underlying issue is My first idea was to store the newest (greatest) My second idea is to store 🦆 I think the only real solution is to have the Client keep track of incoming |
Describe the bug
If a progressive call
InvocationHandler
(callee) function returns an error before it receives the final progressive message from the caller:Client
cannot be closed because of a blocking write to a full chanresChan <- handler(ctx, msg)
To Reproduce
I wrote a test function that can be dropped into
client_test.go
. I'll include it at the end.Expected behavior
According to the second example in Continuations on Completed Calls
Emphasis my own, but because Nexus is handling the protocol, it should not call the handler function after the handler returns an error.
More importantly, it should not deadlock when the handler returns an error before the caller is done sending progressive invocations. The diagram that follows the above quoted text clearly shows this is legal.
Environment (please complete the following information):
v3
HEAD5cfa511313807ad6802ff4b5a2b738d18507ef23
Additional context
Test:
Terminal output:
I'll likely put up a PR in the coming days, but if a maintainer wants to tackle this, just please let me know.
The text was updated successfully, but these errors were encountered: