Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-108277: Add wrapper for timerfd_create, timerfd_settime, and timerfd_gettime to os module#108382

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
vstinner merged 170 commits intopython:mainfromm-tmatma:feature/os.timerfd_xxx
Oct 7, 2023

Conversation

m-tmatma
Copy link
Contributor

@m-tmatmam-tmatma commentedAug 23, 2023
edited
Loading

Add wrapper for timerfd system calls.

Note: local test

python3 Tools/clinic/clinic.py -f Modules/posixmodule.c &&  \autoconf -i && \./configure && \make regen-configure && \make -j4 regen-all   && \make regen-stdlib-module-names &&  \make test TESTOPTS="-v test_os" && \make -C Doc venv && make -C Doc html

📚 Documentation preview 📚:https://cpython-previews--108382.org.readthedocs.build/

@ghost

This comment was marked as resolved.

@bedevere-bot

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@bedevere-bot

This comment was marked as outdated.

@m-tmatmam-tmatmaforce-pushed thefeature/os.timerfd_xxx branch 5 times, most recently from61a9908 toebd989fCompareAugust 26, 2023 09:34
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In general LGTM, but we must first discuss what exactly we want to get.

@serhiy-storchaka
Copy link
Member

Please add also an entry in the What's New file.

erlend-aasland reacted with thumbs up emoji

@erlend-aasland
Copy link
Contributor

Just a heads-up,@m-tmatma: please don't force-push; instead,git merge --no-ff main. It makes for a better review experience, since both CI runs and comments can be tied to specific commits.

@m-tmatma
Copy link
ContributorAuthor

@erlend-aasland

Just a heads-up,@m-tmatma: please don't force-push; instead,git merge --no-ff main. It makes for a better review experience, since both CI runs and comments can be tied to specific commits.

Sorry, I thought force-push is a manner to contribute.

erlend-aasland reacted with heart emoji

@m-tmatma
Copy link
ContributorAuthor

@serhiy-storchaka

Please add also an entry in the What's New file.

Added.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. Thanks for all updates!

IMO using _PyTime_t API and passing the rounding method from the time module is the right way to handle rounding.

@vstinnervstinner merged commitde2a403 intopython:mainOct 7, 2023
@vstinner
Copy link
Member

I merged your PR, thanks@m-tmatma for your great work!

Some remarks:

  • The PR got reviewed by multiple core devs.
  • IMO os.rst doc should have a link to the HOWTO: please propose a follow-up PR for that.
  • I like the API with only 1 positional-only parameter, and then keyword-only arguments: we need more APIs like that :-)
  • I'm scared by the size of the change, the size of the API, but I'm reassured by the length of the documentation and the length of the tests. Thanks for writing all of that!
  • I also merged this PR because it has too many comments, too many commits. It became really hard to track it :-) I merge it to have a "starting point". Later, we can obviously enhance doc/implementation/tests/whatever.

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 RHEL7 3.x has failed when building commitde2a403.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/15/builds/5889) and take a look at the build logs.
  4. Check if the failure is related to this commit (de2a403) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/15/builds/5889

Failed tests:

  • test_os

Failed subtests:

  • test_timerfd_negative - test.test_os.TimerfdTests.test_timerfd_negative

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/buildbot/buildarea/3.x.cstratak-RHEL7-x86_64/build/Lib/test/test_os.py", line3987, intest_timerfd_negativefor flagsin (0, os.TFD_TIMER_ABSTIME, os.TFD_TIMER_ABSTIME|os.TFD_TIMER_CANCEL_ON_SET):^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError:module 'os' has no attribute 'TFD_TIMER_CANCEL_ON_SET'

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbots390x RHEL7 3.x has failed when building commitde2a403.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/179/builds/5673) and take a look at the build logs.
  4. Check if the failure is related to this commit (de2a403) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/179/builds/5673

Failed tests:

  • test_os

Failed subtests:

  • test_timerfd_negative - test.test_os.TimerfdTests.test_timerfd_negative

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z/build/Lib/test/test_os.py", line3987, intest_timerfd_negativefor flagsin (0, os.TFD_TIMER_ABSTIME, os.TFD_TIMER_ABSTIME|os.TFD_TIMER_CANCEL_ON_SET):^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError:module 'os' has no attribute 'TFD_TIMER_CANCEL_ON_SET'

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbots390x RHEL7 LTO + PGO 3.x has failed when building commitde2a403.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/244/builds/5632) and take a look at the build logs.
  4. Check if the failure is related to this commit (de2a403) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/244/builds/5632

Failed tests:

  • test_os

Failed subtests:

  • test_timerfd_negative - test.test_os.TimerfdTests.test_timerfd_negative

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto-pgo/build/Lib/test/test_os.py", line3987, intest_timerfd_negativefor flagsin (0, os.TFD_TIMER_ABSTIME, os.TFD_TIMER_ABSTIME|os.TFD_TIMER_CANCEL_ON_SET):^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError:module 'os' has no attribute 'TFD_TIMER_CANCEL_ON_SET'

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbots390x RHEL7 LTO 3.x has failed when building commitde2a403.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/402/builds/5581) and take a look at the build logs.
  4. Check if the failure is related to this commit (de2a403) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/402/builds/5581

Failed tests:

  • test_os

Failed subtests:

  • test_timerfd_negative - test.test_os.TimerfdTests.test_timerfd_negative

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/dje/cpython-buildarea/3.x.edelsohn-rhel-z.lto/build/Lib/test/test_os.py", line3987, intest_timerfd_negativefor flagsin (0, os.TFD_TIMER_ABSTIME, os.TFD_TIMER_ABSTIME|os.TFD_TIMER_CANCEL_ON_SET):^^^^^^^^^^^^^^^^^^^^^^^^^^AttributeError:module 'os' has no attribute 'TFD_TIMER_CANCEL_ON_SET'

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbotAMD64 Ubuntu Shared 3.x has failed when building commitde2a403.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/506/builds/6080) and take a look at the build logs.
  4. Check if the failure is related to this commit (de2a403) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/506/builds/6080

Failed tests:

  • test_os

Failed subtests:

  • test_timerfd_ns_TFD_TIMER_ABSTIME - test.test_os.TimerfdTests.test_timerfd_ns_TFD_TIMER_ABSTIME

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_os.py", line4211, intest_timerfd_ns_TFD_TIMER_ABSTIMEself.assertGreater(t, offset_ns)AssertionError:999978637 not greater than 1000000000

@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbots390x Fedora Clang 3.x has failed when building commitde2a403.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/3/builds/4767) and take a look at the build logs.
  4. Check if the failure is related to this commit (de2a403) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/3/builds/4767

Failed tests:

  • test_os

Failed subtests:

  • test_timerfd_ns_TFD_TIMER_ABSTIME - test.test_os.TimerfdTests.test_timerfd_ns_TFD_TIMER_ABSTIME
  • test_timerfd_TFD_TIMER_ABSTIME - test.test_os.TimerfdTests.test_timerfd_TFD_TIMER_ABSTIME

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):  File"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/test/test_os.py", line4211, intest_timerfd_ns_TFD_TIMER_ABSTIMEself.assertGreater(t, offset_ns)AssertionError:999998128 not greater than 1000000000Traceback (most recent call last):  File"/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/test/test_os.py", line4058, intest_timerfd_TFD_TIMER_ABSTIMEself.assertGreater(t, offset)AssertionError:0.9999921415001154 not greater than 1

@m-tmatma
Copy link
ContributorAuthor

@vstinner
Thank you for merging.

@m-tmatmam-tmatma deleted the feature/os.timerfd_xxx branchOctober 7, 2023 20:55
@vstinner
Copy link
Member

@m-tmatma: Now you can enjoy the great pleasure of having to fix test failures :-) Look at previous comments from buildbots.

======================================================================FAIL: test_timerfd_TFD_TIMER_ABSTIME (test.test_os.TimerfdTests.test_timerfd_TFD_TIMER_ABSTIME)----------------------------------------------------------------------Traceback (most recent call last):  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/test/test_os.py", line 4058, in test_timerfd_TFD_TIMER_ABSTIME    self.assertGreater(t, offset)AssertionError: 0.9999921415001154 not greater than 1======================================================================FAIL: test_timerfd_ns_TFD_TIMER_ABSTIME (test.test_os.TimerfdTests.test_timerfd_ns_TFD_TIMER_ABSTIME)----------------------------------------------------------------------Traceback (most recent call last):  File "/home/dje/cpython-buildarea/3.x.edelsohn-fedora-z.clang/build/Lib/test/test_os.py", line 4211, in test_timerfd_ns_TFD_TIMER_ABSTIME    self.assertGreater(t, offset_ns)AssertionError: 999998128 not greater than 1000000000

@m-tmatma
Copy link
ContributorAuthor

@vstinner
sorry, but I'm going to travel. so it takes a week to start fixing.

@m-tmatma
Copy link
ContributorAuthor

@vstinner
I didn't notice these failures until the PR
was merged.

Some tests are only run only on main branch?

There were some difficulties when I had developed this feature because actions was not enabled on feature branches.

I think all actions jobs should be run on feature branches or at least PRs to prevent the case on the PR.

@vstinner
Copy link
Member

@vstinner: I didn't notice these failures until the PR was merged.

It's because buildbots are not run before a PR is actually merged, until someone asks explicitly to run buildbots on a PR, which wasn't done.

It's ok. I may have a look at these failures and try to fix them.

@vstinner
Copy link
Member

On AMD64 RHEL7 3.x, test_timerfd_negative() fails because os.TFD_TIMER_CANCEL_ON_SET doesn't exist. test.pythoninfo:

os.uname: posix.uname_result(sysname='Linux', nodename='python-builder-rhel7.osci.io', release='3.10.0-1160.95.1.el7.x86_64', version='#1 SMP Fri Jun 23 08:44:55 EDT 2023', machine='x86_64')platform.architecture: 64bit ELFplatform.freedesktop_os_release[ID]: rhelplatform.freedesktop_os_release[NAME]: Red Hat Enterprise Linux Serverplatform.freedesktop_os_release[VARIANT_ID]: serverplatform.freedesktop_os_release[VERSION]: 7.9 (Maipo)platform.freedesktop_os_release[VERSION_ID]: 7.9platform.libc_ver: glibc 2.17platform.platform: Linux-3.10.0-1160.95.1.el7.x86_64-x86_64-with-glibc2.17

@vstinner
Copy link
Member

AMD64 Ubuntu Shared 3.x:https://buildbot.python.org/all/#/builders/506/builds/6080

FAIL: test_timerfd_ns_TFD_TIMER_ABSTIME (test.test_os.TimerfdTests.test_timerfd_ns_TFD_TIMER_ABSTIME)----------------------------------------------------------------------Traceback (most recent call last):  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_os.py", line 4211, in test_timerfd_ns_TFD_TIMER_ABSTIME    self.assertGreater(t, offset_ns)AssertionError: 999978637 not greater than 1000000000

@vstinner
Copy link
Member

I wrote PR#110515 to fix tests.

@m-tmatma
Copy link
ContributorAuthor

@vstinner
Thank you for the PR.

vstinner reacted with heart emoji

@vstinner
Copy link
Member

It seems like buildbots are happy, good. Refleaks will run with the fix this night.

Glyphack pushed a commit to Glyphack/cpython that referenced this pull requestSep 2, 2024
Add wrapper for timerfd_create, timerfd_settime, and timerfd_gettime to os module.Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>Co-authored-by: Victor Stinner <vstinner@python.org>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka left review comments

@AA-TurnerAA-TurnerAA-Turner requested changes

@erlend-aaslanderlend-aaslanderlend-aasland left review comments

@vstinnervstinnervstinner approved these changes

@corona10corona10Awaiting requested review from corona10corona10 is a code owner

@pgansslepganssleAwaiting requested review from pgansslepganssle is a code owner

@abalkinabalkinAwaiting requested review from abalkinabalkin is a code owner

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

6 participants
@m-tmatma@bedevere-bot@serhiy-storchaka@erlend-aasland@AA-Turner@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp