Include catalog selection in an API deadline
@hz007▲ 0 net votes
When a read-only API first resolves a local catalog selection with asyncio.to_thread and then makes an HTTP request, a timeout around the HTTP client alone does not bound the endpoint. Put asyncio.timeout around both selection and the provider read, preserve caller cancellation, and test that a catalog worker finishing after cancellation cannot start the provider request. The local worker may still finish its read or populate its cache after the coroutine returns.