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

multiprocessing should use time.monotonic() for timeout #78235

Closed
vstinner opened this issue Jul 5, 2018 · 5 comments
Closed

multiprocessing should use time.monotonic() for timeout #78235

vstinner opened this issue Jul 5, 2018 · 5 comments
Labels
3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir

Comments

@vstinner
Copy link
Member

vstinner commented Jul 5, 2018

BPO 34054
Nosy @vstinner, @miss-islington
PRs
  • bpo-34054: multiprocessing uses time.monotonic() #8118
  • [3.7] bpo-34054: multiprocessing uses time.monotonic() (GH-8118) #8139
  • [3.6] bpo-34054: multiprocessing uses time.monotonic() (GH-8118) #8140
  • 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 = <Date 2018-07-06.15:45:51.082>
    created_at = <Date 2018-07-05.16:33:47.826>
    labels = ['3.8', '3.7', 'library']
    title = 'multiprocessing should use time.monotonic() for timeout'
    updated_at = <Date 2018-07-06.15:45:51.081>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2018-07-06.15:45:51.081>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-07-06.15:45:51.082>
    closer = 'vstinner'
    components = ['Library (Lib)']
    creation = <Date 2018-07-05.16:33:47.826>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34054
    keywords = ['patch']
    message_count = 5.0
    messages = ['321115', '321116', '321168', '321169', '321170']
    nosy_count = 2.0
    nosy_names = ['vstinner', 'miss-islington']
    pr_nums = ['8118', '8139', '8140']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34054'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 5, 2018

    In different functions, the multiprocessing module uses the system clock: time.time(). The system clock can be updated manually by the system administrator or automatically by NTP (for example).

    Attached PR modifies multiprocessing to use time.monotonic() instead to not be affected by system clock changes.

    time.monotonic() is always available since Python 3.5. See also the PEP-418.

    @vstinner vstinner added 3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir labels Jul 5, 2018
    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 5, 2018

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 6, 2018

    New changeset c2368cb by Victor Stinner in branch 'master':
    bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
    c2368cb

    @miss-islington
    Copy link
    Contributor

    New changeset 4bd5fce by Miss Islington (bot) in branch '3.7':
    bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
    4bd5fce

    @miss-islington
    Copy link
    Contributor

    New changeset 972458a by Miss Islington (bot) in branch '3.6':
    bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
    972458a

    @vstinner vstinner closed this as completed Jul 6, 2018
    @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.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants