#527 [API/Perf] Sync subprocess blocks async event loop

closed high Created 2025-12-17 15:00 · Updated 2025-12-17 15:52

Description

Edit
**File:** api/blueprints/v1/workflows.py:115-122 **Problem:** `subprocess.run()` is synchronous and blocks the event loop for up to 10 seconds during Python DSL conversion. Stalls all concurrent requests. **Fix:** Use async subprocess: ```python proc = await asyncio.create_subprocess_exec( 'python3', tmp_file_path, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE, cwd='/tmp' ) stdout, stderr = await asyncio.wait_for(proc.communicate(), timeout=10) ``` **Impact:** Prevents event loop stalling. Handles 10x more concurrent DSL submissions.

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...