GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Allow overriding future-task compliance check in asyncio · Issue #91323 · python/cpython

Allow overriding future-task compliance check in asyncio #91323

New issue
Copy link
New issue
Copy link
Closed
Closed
Allow overriding future-task compliance check in asyncio#91323
Copy link
Labels
3.11only security fixesonly security fixestopic-asyncio

Description

@asvetlov
asvetlov
opened on Mar 30, 2022
Issue body actions
BPO 47167
Nosy @asvetlov, @1st1
PRs
  • bpo-47167: Allow overriding a future compliance check in asyncio.Task #32197
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2022-03-30.15:34:50.023>
    labels = ['3.11', 'expert-asyncio']
    title = 'Allow overriding future-task compliance check in  asyncio'
    updated_at = <Date 2022-04-01.02:14:55.054>
    user = 'https://github.com/asvetlov'

    bugs.python.org fields:

    activity = <Date 2022-04-01.02:14:55.054>
    actor = 'yselivanov'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['asyncio']
    creation = <Date 2022-03-30.15:34:50.023>
    creator = 'asvetlov'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 47167
    keywords = ['patch']
    message_count = 3.0
    messages = ['416374', '416467', '416468']
    nosy_count = 2.0
    nosy_names = ['asvetlov', 'yselivanov']
    pr_nums = ['32197']
    priority = 'normal'
    resolution = None
    stage = 'resolved'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue47167'
    versions = ['Python 3.11']

    Activity

    1. asvetlov commented on Mar 30, 2022

      @asvetlov
      asvetlov
      on Mar 30, 2022
      ContributorAuthor
      More actions

      Now asyncio.Task has a strict hardcoded check for futures processes on task's step.
      Sometimes third-party library [1] wants to replace it with custom logic.
      Currently it is impossible without implementing the full asyncio.Task replacement from scratch.
      asyncio.Task is a non-trivial highly optimized part of async, keeping a third-party version in sync with the reference implementation takes more time and effort than it should be.

      This issue proposes adding Task._check_future(future) method that could be overridden in subclasses. The default C implementation uses a fast path that has no performance penalty.

      1. https://github.com/aio-libs/aioloop-proxy implements nested loop proxies that are very useful for writing tests. A proxy can work in parallel with ancestors but checks all own acquired resources cleanup on
        the proxy closing.
    2. asvetlov
      added
      3.11only security fixesonly security fixes
      topic-asyncio
      on Mar 30, 2022
    3. asvetlov commented on Apr 1, 2022

      @asvetlov
      asvetlov
      on Apr 1, 2022
      ContributorAuthor
      More actions

      New changeset d4bb38f by Andrew Svetlov in branch 'main':
      bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197)
      d4bb38f

    4. asvetlov
      closed this as completedon Apr 1, 2022
    5. asvetlov
      closed this as completedon Apr 1, 2022
    6. 1st1 commented on Apr 1, 2022

      @1st1
      1st1
      on Apr 1, 2022
      Member
      More actions

      Sorry, I don't like the committed change and I think it should be reverted.

      Futures and Tasks have a documented get_loop() method which simply should be called by Task machinery, without the need to expose (and document) private methods.

    7. 1st1
      reopened this on Apr 1, 2022
    8. 1st1
      reopened this on Apr 1, 2022
    9. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    10. ezio-melotti
      added this to asyncioon Jun 20, 2022
    11. ezio-melotti
      moved this to Todo in asyncioon Jul 17, 2022
    12. graingert commented on Jul 25, 2022

      @graingert
      graingert
      on Jul 25, 2022
      Contributor
      More actions

      This patch isn't needed to support the aioloop-proxy use case, you can use an interceptor coroutine to pass the check instead:

      aio-libs/aioloop-proxy@a655652

      this way aioloop proxy works with asyncio.Task CTask PyTask and in addition custom set_task_factory Tasks

      Reacted by Łukasz Langa
    13. ambv
      added a commit that references this issue on Aug 4, 2022

      gh-91323: Revert "Allow overriding a future compliance check in async…

      0342c93
    14. miss-islington
      added a commit that references this issue on Aug 4, 2022

      pythongh-91323: Revert "Allow overriding a future compliance check in…

      5202170
    15. ambv
      added a commit that references this issue on Aug 4, 2022

      gh-91323: Revert "Allow overriding a future compliance check in async…

      5ac3d0f
    16. kumaraditya303 commented on Oct 9, 2022

      @kumaraditya303
      kumaraditya303
      on Oct 9, 2022
      Contributor
      More actions

      Closing as the PR was reverted and it is not needed #91323 (comment).

    17. kumaraditya303
      closed this as completedon Oct 9, 2022
    18. Repository owner moved this from Todo to Done in asyncioon Oct 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixesonly security fixestopic-asyncio

      Projects

      • asyncio
        Status
        Done
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.