Since anyio 4.0, all task groups raise ExceptionGroups by default. We need to check whether that causes us to miss exceptions, and whether we are passing exception groups to users where we do not intent to raise one.
I did a quick scan for where we use task groups in the main code, assuming that no other anyio functions raise exception groups:
|
task_group = await self.enter_async_context(anyio.create_task_group()) |
|
task_group = await self.enter_async_context(anyio.create_task_group()) |
|
async def __call__(self, message_aiter, *, metadata=None): |
|
stream = await self._stream_fn(metadata=metadata) |
|
async with anyio.create_task_group() as task_group: |
|
task_group.start_soon(send_multiple_messages_client, stream, message_aiter) |
|
return await extract_message_from_singleton_stream(stream) |
|
async def call_aiter(self, message_aiter, metadata): |
|
stream = await self._stream_fn(metadata=metadata) |
|
|
|
async with anyio.create_task_group() as task_group: |
|
task_group.start_soon(send_multiple_messages_client, stream, message_aiter) |
|
yield stream_to_async_iterator(stream) |
|
async with GRPCProtoSocket(self.config, stream_) as grpc_socket: |
|
# TODO: resource usage warning |
|
# TODO: TaskGroup() uses a lot of memory if the connection is kept for a long time |
|
# TODO: do we really need it here? |
|
async with anyio.create_task_group() as task_group: |
|
async for stream in grpc_socket.listen(): |
|
task_group.start_soon(self.request_received, stream) |
Other uses of tasks groups is in tests and some sample scripts. While those probably should be double checked, the ones above are the most important ones.
Since anyio 4.0, all task groups raise ExceptionGroups by default. We need to check whether that causes us to miss exceptions, and whether we are passing exception groups to users where we do not intent to raise one.
I did a quick scan for where we use task groups in the main code, assuming that no other anyio functions raise exception groups:
purerpc/src/purerpc/grpc_socket.py
Line 30 in a3c17dd
purerpc/src/purerpc/grpc_socket.py
Line 216 in a3c17dd
purerpc/src/purerpc/wrappers.py
Lines 103 to 107 in a3c17dd
purerpc/src/purerpc/wrappers.py
Lines 112 to 117 in a3c17dd
purerpc/src/purerpc/server.py
Lines 219 to 225 in a3c17dd
Other uses of tasks groups is in tests and some sample scripts. While those probably should be double checked, the ones above are the most important ones.