-
Notifications
You must be signed in to change notification settings - Fork 138
add cancel_reason to RpcInvocationData #809
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
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 |
|---|---|---|
|
|
@@ -676,7 +676,10 @@ def _on_deadline() -> None: | |
| # only a cancel the chain accepted counts: cancel() is False when the chain has | ||
| # already finished, which can happen in the same loop iteration the timer fires | ||
| # while this task has not resumed yet; that result is the caller's, not a timeout | ||
| invocation.cancel_reason = RpcError.ErrorCode.RESPONSE_TIMEOUT | ||
|
Contributor
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. 🟡 Concurrent disconnect records wrong reason When a room disconnect races the response deadline, Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
| deadline_fired = chain_task.cancel() | ||
| if not deadline_fired: | ||
| invocation.cancel_reason = None | ||
|
|
||
| deadline = loop.call_later(invocation.response_timeout, _on_deadline) | ||
| try: | ||
|
|
@@ -691,6 +694,7 @@ def _on_deadline() -> None: | |
| except asyncio.CancelledError: | ||
| # cancelled from outside: stop the chain and let it unwind before answering the | ||
| # caller, but not for long; this is the path room.disconnect() waits on | ||
| invocation.cancel_reason = RpcError.ErrorCode.RECIPIENT_DISCONNECTED | ||
| chain_task.cancel() | ||
| _, pending = await asyncio.wait([chain_task], timeout=_RPC_CANCEL_UNWIND_TIMEOUT) | ||
| if pending: | ||
|
|
||