MagicStack / MagicStack/uvloop

TypeError: create_task() got an unexpected keyword argument 'eager_start'

Đang mở
#754 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
Cython
Star
11.9k
Fork
615
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu tại uvloop.loop.Loop.create_task trong loop.pyx, nơi traceback cho thấy đối số từ khóa eager_start của Python 3.14 bị từ chối, và so sánh với hành vi của asyncio.create_task. Xác định cách uvloop nên chấp nhận và tôn trọng eager_start=True thay vì chỉ bỏ qua nó; hoàn thành khi lệnh gọi được báo cáo hoạt động trên uvloop với ngữ nghĩa eager-start dự kiến.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.