MagicStack / MagicStack/uvloop

Loop.call_later(0) and Loop.call_later(-1) return a uvloop.loop.Handle and not an asyncio.TimerHandle

Open
#482 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cython
Stars
11.9k
Forks
616
PR merge metrics
No merged PRs in 30d

Description

* **uvloop version**: master
* **Python version**: 3.10
* **Platform**: ubuntu
* **Can you reproduce the bug with `PYTHONASYNCIODEBUG` in env?**: yes
* **Does uvloop behave differently from vanilla asyncio? How?**: yes

```
Python 3.10.5 (main, Jun 11 2022, 16:53:24) [GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncio
>>> import uvloop
>>> uvloop.new_event_loop().call_later(-1, lambda: None)
>
>>> asyncio.new_event_loop().call_later(-1, lambda: None)
() at :1>
>>>
```
the bug is here:
https://github.com/MagicStack/uvloop/blob/5926386f81ea49903db9d5095058787ed91cff3d/uvloop/loop.pyx#L1327-L1328

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in uvloop/loop.pyx at lines 1327-1328 and compare the behavior of Loop.call_later(0) and Loop.call_later(-1) with vanilla asyncio. Done means both uvloop calls return an asyncio.TimerHandle rather than a uvloop.loop.Handle, including when PYTHONASYNCIODEBUG is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.