TypeError: create_task() got an unexpected keyword argument 'eager_start'
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start at uvloop.loop.Loop.create_task in loop.pyx, where the traceback shows Python 3.14's eager_start keyword is rejected, and compare it with asyncio.create_task's behavior. Determine how uvloop should accept and respect eager_start=True without merely ignoring it; done means the reported call works under uvloop with the intended eager-start semantics.
Written by the indexing model from the issue text.
Description
python 3.14.2 asyncio.create_task() accepts a kwarg eager_start: True. uvloop 0.22.1 does not and raises a type error:
File "/Users/enda/Workspaces/project/api/src/prject/queries/counts.py", line 84, in _single_flight
task = asyncio.create_task(_run(), name=f"single_flight:{key}", eager_start=True)
File "/Users/enda/.local/share/uv/python/cpython-3.14.2-macos-aarch64-none/lib/python3.14/asyncio/tasks.py", line 395, in create_task
return loop.create_task(coro, **kwargs)
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
File "uvloop/loop.pyx", line 1415, in uvloop.loop.Loop.create_task
TypeError: create_task() got an unexpected keyword argument 'eager_start'
I understand that "accept but ignore-with-a-warning" is not a desirable approach as developers will expect that passing this in as True will cause the task to start eagerly. However, at present the first sentence of the project "uvloop is a fast, drop-in replacement of the built-in asyncio event loop. " is no longer100% accurate and that's not desired either.
I've only recently become aware of eager_start but it /seems/ to have been in discussion for over 18 months: https://discuss.python.org/t/make-asyncio-eager-task-factory-default/75164 (and uvloop gets a mention in there).
As I don't know what is involved in accepting and respecting an eager_start=True I don't want to say what I expect this issue to amount to, but it made its way pasting our testing as we were not using uvloop in the original tests which covered our _single_flight code, but our deployed code hit it. Clearly we have now fixed that testing oversite but others may experience this too.
- Dominant language
- Cython
- Stars
- 11.9k
- Forks
- 615
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from MagicStack/uvloop
-
License not clear Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#759 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#741 · 2 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MagicStack/uvloop#702 · 8 comments · 9 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
MagicStack/uvloop#763 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
MagicStack/uvloop#760 ·
All issues in MagicStack/uvloop
Similar issues
-
area/sessions comp/cron comp/gateway P2 sweeper:risk-message-delivery sweeper:risk-session-state type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#118863 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
use-agent-os/agent-os#3312 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
needs-acceptance wg/data-plane-networking
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/semantic-router#4024 · 1 comment ·