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

Python threading.Event().wait() depends on the system time #91394

Open
AleksandrAQ mannequin opened this issue Apr 6, 2022 · 1 comment
Open

Python threading.Event().wait() depends on the system time #91394

AleksandrAQ mannequin opened this issue Apr 6, 2022 · 1 comment
Labels
3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@AleksandrAQ
Copy link
Mannequin

AleksandrAQ mannequin commented Apr 6, 2022

BPO 47238
Nosy @AleksandrAQ
Files
  • reproduction.py: You need root privileges to change the system time.
  • 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-04-06.10:19:09.231>
    labels = ['3.8', 'type-bug', 'library']
    title = 'Python threading.Event().wait() depends on the system time'
    updated_at = <Date 2022-04-06.10:19:09.231>
    user = 'https://github.com/AleksandrAQ'

    bugs.python.org fields:

    activity = <Date 2022-04-06.10:19:09.231>
    actor = 'AleksandrAQ'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2022-04-06.10:19:09.231>
    creator = 'AleksandrAQ'
    dependencies = []
    files = ['50725']
    hgrepos = []
    issue_num = 47238
    keywords = []
    message_count = 1.0
    messages = ['416851']
    nosy_count = 1.0
    nosy_names = ['AleksandrAQ']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue47238'
    versions = ['Python 3.8']

    @AleksandrAQ
    Copy link
    Mannequin Author

    AleksandrAQ mannequin commented Apr 6, 2022

    This happens on Ubuntu on Python versions 3.8.5 and 3.10.4

    I have two threads that can change the system time to a day ago.
    If the change in the system time for a day occurs at the time of wait, then I hang for one day plus the waiting time.

    I thought Event.wait() uses a monotonous clock, but this behavior points to an absolute clock.

    Are there any solutions?

    @AleksandrAQ AleksandrAQ mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Apr 6, 2022
    @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 stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    Status: No status
    Development

    No branches or pull requests

    0 participants