Add more async calls to compute_provider#1369
Conversation
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughSynchronous compute-provider operations in the router were moved onto background threads via Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@api/transformerlab/routers/compute_provider.py`:
- Line 2673: The router currently calls provider_instance.submit_job via
asyncio.to_thread (using symbols provider_instance.submit_job,
asyncio.to_thread, cluster_name, job_config); move this execution into a new or
existing service in api/transformerlab/services (e.g., add a
ComputeProviderService.submit_job method) that encapsulates the threading and
provider invocation, then have the router call that service method and await its
result so the router only orchestrates HTTP I/O; likewise refactor the other
provider-executing calls referenced (the coroutine/threading usages at the other
spots) into corresponding service methods and replace direct
asyncio.to_thread/provider_instance calls in the router with simple service
calls.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
I think this will address the submit job call causing healthz to timeout. Fixes #1367
Summary by CodeRabbit