GeezerVison is showing github.com — gh-108277: Add wrapper for timerfd_create, timerfd_settime, and timerfd_gettime to os module by m-tmatma · Pull Request #108382 · python/cpython
Conversation
m-tmatma
commented
Aug 23, 2023
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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/
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
|
Please add also an entry in the What's New file.
|
erlend-aasland reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ttime, and timerfd_gettime to 'os' module.
|
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, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@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
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 RHEL7 3.x has failed when building commit de2a403.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (de2a403) or if it is a false positive.
- 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:
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", line 3987, in test_timerfd_negative
for flags in (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'
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x RHEL7 3.x has failed when building commit de2a403.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (de2a403) or if it is a false positive.
- 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:
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", line 3987, in test_timerfd_negative
for flags in (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'
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x RHEL7 LTO + PGO 3.x has failed when building commit de2a403.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (de2a403) or if it is a false positive.
- 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:
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", line 3987, in test_timerfd_negative
for flags in (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'
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x RHEL7 LTO 3.x has failed when building commit de2a403.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (de2a403) or if it is a false positive.
- 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:
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", line 3987, in test_timerfd_negative
for flags in (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'
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot AMD64 Ubuntu Shared 3.x has failed when building commit de2a403.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (de2a403) or if it is a false positive.
- 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:
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", line 4211, in test_timerfd_ns_TFD_TIMER_ABSTIME
self.assertGreater(t, offset_ns)
AssertionError: 999978637 not greater than 1000000000
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️
Hi! The buildbot s390x Fedora Clang 3.x has failed when building commit de2a403.
What do you need to do:
- Don't panic.
- Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
- 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.
- Check if the failure is related to this commit (de2a403) or if it is a false positive.
- 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:
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", line 4211, in test_timerfd_ns_TFD_TIMER_ABSTIME
self.assertGreater(t, offset_ns)
AssertionError: 999998128 not greater than 1000000000
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@vstinner
sorry, but I'm going to travel. so it takes a week to start fixing.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
@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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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 ELF
platform.freedesktop_os_release[ID]: rhel
platform.freedesktop_os_release[NAME]: Red Hat Enterprise Linux Server
platform.freedesktop_os_release[VARIANT_ID]: server
platform.freedesktop_os_release[VERSION]: 7.9 (Maipo)
platform.freedesktop_os_release[VERSION_ID]: 7.9
platform.libc_ver: glibc 2.17
platform.platform: Linux-3.10.0-1160.95.1.el7.x86_64-x86_64-with-glibc2.17
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
vstinner reacted with heart emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
It seems like buildbots are happy, good. Refleaks will run with the fix this night.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|