Skip to content

Set the new event loop - #238

Merged
bobh66 merged 1 commit into
crossplane:mainfrom
bobh66:set_event_loop
Sep 23, 2026
Merged

bobh66 merged 1 commit into
crossplane:mainfrom
bobh66:set_event_loop

Conversation

@bobh66

@bobh66 bobh66 commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description of your changes

Call asyncio.set_event_loop() after allocating a new loop so that it is available to the process.

Running in 3.14 produces the error:

Cannot run function: Task <Task pending name='Task-3' coro=<Server.stop() running at /Users/bhaddlet/git/function-python/.venv/lib/python3.14/site-packages/grpc/aio/_server.py:185> cb=[_run_until_complete_cb() at /Users/bhaddlet/Library/Application Support/uv/python/cpython-3.14.6-macos-aarch64-none/lib/python3.14/asyncio/base_events.py:181]> got Future <Task pending name='Task-2' coro=<AioServer._server_main_loop() running at src/python/grpcio/grpc/_cython/_cygrpc/aio/server.pyx.pxi:None> cb=[AioServer._serving_task_crash_handler()]> attached to a different loop

I have:

  • Read and followed Crossplane's contribution process.
    - [ ] Added or updated unit tests for my change.

Tested in local development environment with private copy of the SDK in function-python, using 3.14

Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
@bobh66
bobh66 requested a review from negz as a code owner September 23, 2026 17:42
@bobh66
bobh66 requested a review from jcogilvie September 23, 2026 17:44
@bobh66
bobh66 removed the request for review from jcogilvie September 23, 2026 18:36
@bobh66
bobh66 merged commit af9f047 into crossplane:main Sep 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants