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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-108294: Add time.sleep audit event #108298

Merged
merged 1 commit into from
Aug 23, 2023
Merged

Conversation

encukou
Copy link
Member

@encukou encukou commented Aug 22, 2023

@encukou encukou marked this pull request as ready for review August 22, 2023 14:25
@encukou encukou changed the title gh-108294: Add time.sleep audit hook gh-108294: Add time.sleep audit event Aug 22, 2023
Copy link
Contributor

@ambv ambv left a comment

Choose a reason for hiding this comment

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

I like the reasoning behind the feature. Tests work on my end.

@encukou encukou merged commit 31b61d1 into python:main Aug 23, 2023
26 checks passed
@@ -414,6 +414,8 @@ Return the clk_id of a thread's CPU time clock.");
static PyObject *
time_sleep(PyObject *self, PyObject *timeout_obj)
{
PySys_Audit("time.sleep", "O", timeout_obj);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why no error handling?

Copy link
Member Author

Choose a reason for hiding this comment

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

I could tell you but it would sound like a lame excuse. (I picked up a low-priority task from May, and didn't realize how much work-in-progress it was...)

Thank you very much for spotting this! Fix incoming.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fix in #108363.

@bedevere-bot
Copy link

鈿狅笍鈿狅笍鈿狅笍 Buildbot failure 鈿狅笍鈿狅笍鈿狅笍

Hi! The buildbot s390x RHEL8 LTO 3.x has failed when building commit 31b61d1.

What do you need to do:

  1. Don't panic.
  2. Check the 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/567/builds/4733) and take a look at the build logs.
  4. Check if the failure is related to this commit (31b61d1) 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/567/builds/4733

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

== Tests result: ENV CHANGED ==

431 tests OK.

10 slowest tests:

  • test_tools: 7 min 16 sec
  • test_gdb: 2 min 37 sec
  • test_concurrent_futures: 2 min 19 sec
  • test_multiprocessing_spawn: 1 min 40 sec
  • test_signal: 1 min 20 sec
  • test_multiprocessing_fork: 1 min 14 sec
  • test_multiprocessing_forkserver: 1 min 11 sec
  • test_math: 36.3 sec
  • test_io: 35.5 sec
  • test_imaplib: 33.1 sec

1 test altered the execution environment:
test_ssl

15 tests skipped:
test.test_asyncio.test_windows_events
test.test_asyncio.test_windows_utils test_devpoll test_ioctl
test_kqueue test_launcher test_perf_profiler test_startfile
test_tkinter test_ttk test_winconsoleio test_winreg test_winsound
test_wmi test_zipfile64

Total duration: 10 min 38 sec

Click to see traceback logs
remote: Enumerating objects: 41, done.        
remote: Counting objects:   2% (1/41)        
remote: Counting objects:   4% (2/41)        
remote: Counting objects:   7% (3/41)        
remote: Counting objects:   9% (4/41)        
remote: Counting objects:  12% (5/41)        
remote: Counting objects:  14% (6/41)        
remote: Counting objects:  17% (7/41)        
remote: Counting objects:  19% (8/41)        
remote: Counting objects:  21% (9/41)        
remote: Counting objects:  24% (10/41)        
remote: Counting objects:  26% (11/41)        
remote: Counting objects:  29% (12/41)        
remote: Counting objects:  31% (13/41)        
remote: Counting objects:  34% (14/41)        
remote: Counting objects:  36% (15/41)        
remote: Counting objects:  39% (16/41)        
remote: Counting objects:  41% (17/41)        
remote: Counting objects:  43% (18/41)        
remote: Counting objects:  46% (19/41)        
remote: Counting objects:  48% (20/41)        
remote: Counting objects:  51% (21/41)        
remote: Counting objects:  53% (22/41)        
remote: Counting objects:  56% (23/41)        
remote: Counting objects:  58% (24/41)        
remote: Counting objects:  60% (25/41)        
remote: Counting objects:  63% (26/41)        
remote: Counting objects:  65% (27/41)        
remote: Counting objects:  68% (28/41)        
remote: Counting objects:  70% (29/41)        
remote: Counting objects:  73% (30/41)        
remote: Counting objects:  75% (31/41)        
remote: Counting objects:  78% (32/41)        
remote: Counting objects:  80% (33/41)        
remote: Counting objects:  82% (34/41)        
remote: Counting objects:  85% (35/41)        
remote: Counting objects:  87% (36/41)        
remote: Counting objects:  90% (37/41)        
remote: Counting objects:  92% (38/41)        
remote: Counting objects:  95% (39/41)        
remote: Counting objects:  97% (40/41)        
remote: Counting objects: 100% (41/41)        
remote: Counting objects: 100% (41/41), done.        
remote: Compressing objects:   7% (1/14)        
remote: Compressing objects:  14% (2/14)        
remote: Compressing objects:  21% (3/14)        
remote: Compressing objects:  28% (4/14)        
remote: Compressing objects:  35% (5/14)        
remote: Compressing objects:  42% (6/14)        
remote: Compressing objects:  50% (7/14)        
remote: Compressing objects:  57% (8/14)        
remote: Compressing objects:  64% (9/14)        
remote: Compressing objects:  71% (10/14)        
remote: Compressing objects:  78% (11/14)        
remote: Compressing objects:  85% (12/14)        
remote: Compressing objects:  92% (13/14)        
remote: Compressing objects: 100% (14/14)        
remote: Compressing objects: 100% (14/14), done.        
remote: Total 24 (delta 21), reused 12 (delta 9), pack-reused 0        
From https://github.com/python/cpython
 * branch                  main       -> FETCH_HEAD
Note: switching to '31b61d19abcc63aa28625a31ed75411948fc1e7e'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 31b61d19ab gh-108294: Add time.sleep audit event (GH-108298)
Switched to and reset branch 'main'

make: *** [Makefile:2034: buildbottest] Error 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants