Cancel pending invocations & wait-set entries when client disconnects #13531
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When client wants to execute an operation, a member submits an invocation
on behalf of that client. And when response is received on member-side,
invocation is deregistered and response is forwarded to the client.
If that's a blocking operation, such as lock or reliable-topic message listener,
that operation is parked in a wait-set until it's notified by a notifier operation.
When client is disconnected, entry is wait-set is marked as invalid and removed
from the wait-set eventually.
But invocation on member-side is not notified
and does not receive any response, hence stays in the registry either until timeout
or forever depending on the invocation's target (local or remove)
and/or operation's type (backup-aware or not).
Instead, with this change, when a client is disconnected, wait-set entry will be cancelled
with an exception which then will be propagated to the submitting invocation as a response.
This way, pending invocation will be deregistered.
This is different from the member is removal case. Because members do not submit invocations
on behalf of other members, every member submits and keeps track of its own invocations.
Fixes #13388