Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asyncio: add socket getfqdn and gethostbyaddr functions #87490

Closed
AliyevH mannequin opened this issue Feb 25, 2021 · 6 comments
Closed

asyncio: add socket getfqdn and gethostbyaddr functions #87490

AliyevH mannequin opened this issue Feb 25, 2021 · 6 comments
Labels
3.12 bugs and security fixes pending The issue will be closed if no feedback is provided topic-asyncio type-feature A feature request or enhancement

Comments

@AliyevH
Copy link
Mannequin

AliyevH mannequin commented Feb 25, 2021

BPO 43324
Nosy @asvetlov, @1st1, @AliyevH
PRs
  • bpo-43324: Added socket functions to asyncio library #24651
  • 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 2021-02-25.22:47:07.423>
    labels = ['type-feature', '3.10']
    title = 'asyncio: add socket getfqdn and gethostbyaddr functions'
    updated_at = <Date 2021-02-27.03:53:44.338>
    user = 'https://github.com/AliyevH'

    bugs.python.org fields:

    activity = <Date 2021-02-27.03:53:44.338>
    actor = 'terry.reedy'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = []
    creation = <Date 2021-02-25.22:47:07.423>
    creator = 'AliyevH'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43324
    keywords = ['patch']
    message_count = 1.0
    messages = ['387690']
    nosy_count = 3.0
    nosy_names = ['asvetlov', 'yselivanov', 'AliyevH']
    pr_nums = ['24651']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue43324'
    versions = ['Python 3.10']

    @AliyevH
    Copy link
    Mannequin Author

    AliyevH mannequin commented Feb 25, 2021

    Added socket getfqdn and gethostbyaddr functions with threadpoolexecutor to asyncio library

    @AliyevH AliyevH mannequin added 3.10 only security fixes type-feature A feature request or enhancement labels Feb 25, 2021
    @terryjreedy terryjreedy changed the title asyncio asyncio: add socket getfqdn and gethostbyaddr functions Feb 27, 2021
    @terryjreedy terryjreedy changed the title asyncio asyncio: add socket getfqdn and gethostbyaddr functions Feb 27, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @JelleZijlstra
    Copy link
    Member

    Can you explain the reasoning for this change? Your PR has no tests to demonstrate what this change is useful for.

    @AliyevH
    Copy link
    Contributor

    AliyevH commented Sep 4, 2022

    @JelleZijlstra . getfqdn function sends request to dns server and waits for it to recieve information. and this blocks thread.
    i think it could be good to add asynchronous function too, to simplify it.
    I can add additional change, if you think this pr will be useful too.

    #91802

    @kumaraditya303 kumaraditya303 added topic-asyncio 3.12 bugs and security fixes and removed 3.10 only security fixes labels Sep 6, 2022
    @kumaraditya303
    Copy link
    Contributor

    kumaraditya303 commented Sep 6, 2022

    I don't think that these functions are worth adding wrappers for, you can call these asynchronously with run_in_executor.

    @kumaraditya303 kumaraditya303 added the pending The issue will be closed if no feedback is provided label Sep 6, 2022
    @AliyevH
    Copy link
    Contributor

    AliyevH commented Sep 6, 2022

    @kumaraditya303
    Can you please explain why you think so?
    https://github.com/python/cpython/blob/main/Lib/asyncio/base_events.py#L867
    for functions getnameinfo and getaddrinfo added async wrapper with help run_in_executor.
    Because of it i thought it will be useful for getfqdn and gethostbyaddr too.

    @gvanrossum
    Copy link
    Member

    Yeah, I know that we did this for those specific functions (which are called by other parts of asyncio itself), but I don't think we need to replicate the entire socket API here, especially since it's a one-line recipe to do this yourself.

    @gvanrossum gvanrossum closed this as not planned Won't fix, can't repro, duplicate, stale Sep 6, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.12 bugs and security fixes pending The issue will be closed if no feedback is provided topic-asyncio type-feature A feature request or enhancement
    Projects
    Status: Done
    Development

    No branches or pull requests

    4 participants