[Bugfix] Preserve cancellation in duplex session control queues (#7782)
Signed-off-by: wuli666 <421774554@qq.com>
This commit is contained in:
1 parent
5e6b9047c9
commit
6daf5b30f0
2 files changed
+44
-4
No files matched your search
@@ -214,10 +214,9 @@ class DuplexSessionManager:
|
||||
|
||||
async def run_ordered() -> None:
|
||||
if predecessor is not None:
|
||||
try:
|
||||
await predecessor
|
||||
except BaseException:
|
||||
pass
|
||||
# A predecessor's failure/cancellation must not poison the queue.
|
||||
# Cancelling this task still cancels the gather and propagates.
|
||||
await asyncio.gather(predecessor, return_exceptions=True)
|
||||
await operation()
|
||||
|
||||
task = asyncio.create_task(run_ordered(), name=name)
|
||||
|
||||
Reference in new issue
Block a user