-
Notifications
You must be signed in to change notification settings - Fork 4k
Allow reusing existing event loop for server #10164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
MINOR CHANGES - updated the logic of starting the server to prevent calling asyncio.run() from a running event loop.
|
@DeltaGa Thanks for the PR! This looks great 🙂 We might want to add a test to |
raethlein
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied formatting and added a unit test ✅ Looks good to me now, thanks a lot for your work!
lukasmasuch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
## MINOR CHANGES (1) - Updated the logic of starting the server to prevent calling `asyncio.run()` from a running event loop. ## Describe your changes Refactored the server startup logic to ensure compatibility with both existing and new event loops. This prevents the `RuntimeError` encountered when `asyncio.run()` is called from a running event loop on Python 3.10.16, ## GitHub Issue Link (if applicable) No GitHub issue link available. ## Testing Plan I would be grateful if someone could test the code using the existing tests. The changes have been verified through manual testing. - Explanation of why no additional tests are needed: The refactored code has been manually tested and works as expected. - Unit Tests (JS and/or Python): [@raethlein]: Added a Python unit test to ensure that `bootstrap.run` works with and without an existing asyncio eventloop. - E2E Tests: _None._ - Any manual testing needed? Manual testing was performed to ensure the server starts correctly in both new and existing event loops. --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license. --------- Co-authored-by: raethlein <[email protected]>
MINOR CHANGES (1)
asyncio.run()from a running event loop.Describe your changes
Refactored the server startup logic to ensure compatibility with both existing and new event loops. This prevents the
RuntimeErrorencountered whenasyncio.run()is called from a running event loop on Python 3.10.16,GitHub Issue Link (if applicable)
No GitHub issue link available.
Testing Plan
I would be grateful if someone could test the code using the existing tests. The changes have been verified through manual testing.
Explanation of why no additional tests are needed:
The refactored code has been manually tested and works as expected.
Unit Tests (JS and/or Python):
[@raethlein]: Added a Python unit test to ensure that
bootstrap.runworks with and without an existing asyncio eventloop.E2E Tests:
None.
Any manual testing needed?
Manual testing was performed to ensure the server starts correctly in both new and existing event loops.
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.