MagicStack / MagicStack/uvloop

Can't peek at paused bytes (socket behind TCPTransport unavailable)

Open
#324 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

  • uvloop version: 0.14.0
  • Python version: 3.8.2
  • Platform: linux
  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: n/a (this is an api thing)
  • Does uvloop behave differently from vanilla asyncio? How?:
    • vanilla asyncio: the underlying socket is available in transport._sock for consenting coders aware of the risks using "private" members
    • uvloop: the underlying socket is not available to python at all (or at least I can't find it via introspection)

FWIW, one reason I'm running into this right now is that I have a case where the transport is paused for reading (transport.pause_reading()), but I would still like to peek at the bytes with sock.recv(n, socket.MSG_PEEK).

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 by comparing uvloop's TCP transport with vanilla asyncio's transport._sock behavior, focusing on access while reading is paused. Done means the reported MSG_PEEK use case has a supported way to inspect paused socket bytes through uvloop, with behavior checked against the issue's reproduction details.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.