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

Use fdwalk() within os.closerange() impl if available #82291

Closed
gpshead opened this issue Sep 11, 2019 · 6 comments
Closed

Use fdwalk() within os.closerange() impl if available #82291

gpshead opened this issue Sep 11, 2019 · 6 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes performance Performance or resource usage

Comments

@gpshead
Copy link
Member

gpshead commented Sep 11, 2019

BPO 38110
Nosy @gpshead, @miss-islington, @iritkatriel
PRs
  • bpo-38110: Use fdwalk for os.closerange() when available. #15224
  • [3.8] bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224) #15978
  • 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 = 'https://github.com/gpshead'
    closed_at = <Date 2020-10-11.19:23:32.320>
    created_at = <Date 2019-09-11.13:40:01.508>
    labels = ['3.8', '3.9', 'performance']
    title = 'Use fdwalk() within os.closerange() impl if available'
    updated_at = <Date 2020-10-11.19:23:32.319>
    user = 'https://github.com/gpshead'

    bugs.python.org fields:

    activity = <Date 2020-10-11.19:23:32.319>
    actor = 'gregory.p.smith'
    assignee = 'gregory.p.smith'
    closed = True
    closed_date = <Date 2020-10-11.19:23:32.320>
    closer = 'gregory.p.smith'
    components = ['Demos and Tools']
    creation = <Date 2019-09-11.13:40:01.508>
    creator = 'gregory.p.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38110
    keywords = ['patch']
    message_count = 6.0
    messages = ['351875', '351890', '351927', '351928', '352113', '378375']
    nosy_count = 3.0
    nosy_names = ['gregory.p.smith', 'miss-islington', 'iritkatriel']
    pr_nums = ['15224', '15978']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'performance'
    url = 'https://bugs.python.org/issue38110'
    versions = ['Python 3.8', 'Python 3.9']

    @gpshead
    Copy link
    Member Author

    gpshead commented Sep 11, 2019

    On POSIX platforms that support the fdwalk() API, use it within the os.closerange() implementation.

    @gpshead gpshead added 3.8 only security fixes 3.9 only security fixes performance Performance or resource usage labels Sep 11, 2019
    @gpshead
    Copy link
    Member Author

    gpshead commented Sep 11, 2019

    contribution from Jakub Kulík (see the PR)

    @gpshead gpshead self-assigned this Sep 11, 2019
    @gpshead
    Copy link
    Member Author

    gpshead commented Sep 11, 2019

    """On Solaris, we are patching (for many years now) posix_closerange function to use fdwalk to close file descriptors instead of a for loop. While for a long time only Solaris had fdwalk, but if I am not mistaken, some other OSes implement it today as well and as such others might be interested in this as well.

    If you will like it, I can create an issue for that. Also, I am not sure whether _fdwalk_close_func needs a clinic part or if configure detection is sufficient this way - I am open to all comments and ideas and can rewrite it as needed ;).

    """ - Jakub

    @gpshead
    Copy link
    Member Author

    gpshead commented Sep 11, 2019

    New changeset e20134f by Gregory P. Smith (Jakub Kulík) in branch 'master':
    bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
    e20134f

    @miss-islington
    Copy link
    Contributor

    New changeset 84eb42e by Miss Islington (bot) in branch '3.8':
    bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
    84eb42e

    @iritkatriel
    Copy link
    Member

    This seems complete, can it be closed?

    @gpshead gpshead closed this as completed Oct 11, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants