Problem
AWSRekognition (src/youtube_extension/integrations/cloud_ai/providers/aws_rekognition.py) issues 14 synchronous boto3 calls directly inside async def methods. boto3 has no async API, so every one of these blocks the event loop for a full network round-trip.
| Method |
Blocking boto3 calls |
_test_connection |
describe_collection |
analyze_image |
detect_labels, detect_faces, detect_text, detect_moderation_labels |
get_service_status |
describe_collection |
_start_video_analysis |
start_label_detection, start_face_detection, start_text_detection, start_content_moderation |
_wait_for_job_completion |
get_label_detection, get_face_detection, get_text_detection, get_content_moderation |
_wait_for_job_completion is the worst case — it polls on a 5s interval up to max_wait_time (default 600s), so a single video analysis can stall the loop up to 120 times.
_prepare_image_input additionally does open(image_url, 'rb').read() on the loop for local files (the sibling http(s) branch already correctly uses httpx.AsyncClient).
Reachability evidence
youtube_extension.integrations.cloud_ai.providers.aws_rekognition is in the transitive import closure of the primary production entrypoint (youtube_extension.main:app, root Dockerfile:93):
backend/cloud_ai_routes.py:89,141 maps the aws_rekognition provider
integrations/cloud_ai/integrator.py:297-298 imports and constructs AWSRekognition
main.py:171 mounts cloud_ai_routes
Acceptance criteria
Problem
AWSRekognition(src/youtube_extension/integrations/cloud_ai/providers/aws_rekognition.py) issues 14 synchronous boto3 calls directly insideasync defmethods. boto3 has no async API, so every one of these blocks the event loop for a full network round-trip._test_connectiondescribe_collectionanalyze_imagedetect_labels,detect_faces,detect_text,detect_moderation_labelsget_service_statusdescribe_collection_start_video_analysisstart_label_detection,start_face_detection,start_text_detection,start_content_moderation_wait_for_job_completionget_label_detection,get_face_detection,get_text_detection,get_content_moderation_wait_for_job_completionis the worst case — it polls on a 5s interval up tomax_wait_time(default 600s), so a single video analysis can stall the loop up to 120 times._prepare_image_inputadditionally doesopen(image_url, 'rb').read()on the loop for local files (the siblinghttp(s)branch already correctly useshttpx.AsyncClient).Reachability evidence
youtube_extension.integrations.cloud_ai.providers.aws_rekognitionis in the transitive import closure of the primary production entrypoint (youtube_extension.main:app, rootDockerfile:93):backend/cloud_ai_routes.py:89,141maps theaws_rekognitionproviderintegrations/cloud_ai/integrator.py:297-298imports and constructsAWSRekognitionmain.py:171mountscloud_ai_routesAcceptance criteria
await asyncio.to_thread(...)_prepare_image_inputruns off the loopmain