python-trio / python-trio/trio

Update introspection API for recent changes in nurseries

Open
#386 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugging design discussion potential API breaker
Dominant language
Python
Stars
7.3k
Forks
431
Avg merge
2d 17h
Merged PRs (30d)
6

Description

  1. Currently nursery.start uses some tricky hacks internally that will lead to strange effects in Instrument tracing. We should figure out what this should "look like" to Instruments, and make it happen.

    One option: show the child as directly showing up in the new nursery, as if it really were born there.

    Another option: continue to show the current somewhat-wacky implementation details, but also expose a task_moved event.

  2. With the advent of simplified nurseries, I wonder if we should adjust our tracing code at all to better reflect the symmetry between the contents of the with block and the sibling tasks? For example, should we have trace events for nursery open/close? Should there be an entry in nursery.child_tasks while the with block is still open?

Contributor guide

Open the contributing guide

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

No files or tests are named. Start by reading nursery.start, the Instrument tracing behavior, and nursery.child_tasks; then clarify whether moved children, a task_moved event, nursery open/close events, or child_tasks entries are required. Done means the introspection API consistently reflects the chosen nursery model.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.