Fix: lfx serve asyncio event loop error#10887
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThe PR refactors the server startup mechanism in the CLI by replacing a direct Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touchesImportant Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #10887 +/- ##
==========================================
- Coverage 32.54% 32.54% -0.01%
==========================================
Files 1370 1370
Lines 63543 63544 +1
Branches 9394 9393 -1
==========================================
Hits 20680 20680
Misses 41824 41824
- Partials 1039 1040 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
* fix lfx serve asyncio event loop error * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
lfx serve [flow-json-file-path] ...]throws the following exception:because the
serve_commandhandler is wrapped in asyncifydecorator which creates its own event loop, whileuvicorn.run()tries to create another event loop inside of it. This is fixed by starting the server as a coroutine inside the syncify event loop by callingawait server.serve()directly