Uh oh!
There was an error while loading. Please reload this page.
gh-124872: Replace enter/exit events with "switched" - #125532
Conversation
Eclips4
commented
Oct 15, 2024
With that PR, admin@Admins-MacBook-Air~/p/cpython (revert-of-revert)> ./python.exe-mtest-R3:3test_capiUsingrandomseed: 9920954540:00:00loadavg: 26.10Run1testsequentiallyinasingleprocess0:00:00loadavg: 26.10 [1/1] test_capibeginning6repetitions. Showingnumberofleaks (. for0orless, Xfor10ormore)
123:456XX. ...
test_capipassedin43.3sec==Testsresult: SUCCESS==1testOK.
Totalduration: 43.4secTotaltests: run=985skipped=67Totaltestfiles: run=1/1Result: SUCCESS |
vstinner
commented
Oct 15, 2024
vstinner
commented
Oct 15, 2024
I suggest to wait after Python 3.14.0 alpha1 release to retry this change. |
1st1
commented
Oct 15, 2024
Why? We can debug and fix the ref leak. @rhansen Please build CPython with |
me:
It's just that there are many broken buildbots, I think that this change can wait for 3.14.0a2. |
Eclips4
commented
Oct 15, 2024
FYI, I ran the test suite in hunt refleaks mode locally and it succeeded: ==Testsresult: SUCCESS==25testsskipped:
test.test_asyncio.test_windows_eventstest.test_asyncio.test_windows_utilstest.test_gdb.test_backtracetest.test_gdb.test_cfunctiontest.test_gdb.test_cfunction_fulltest.test_gdb.test_misctest.test_gdb.test_pretty_printtest.test_multiprocessing_fork.test_managertest.test_multiprocessing_fork.test_misctest.test_multiprocessing_fork.test_processestest.test_multiprocessing_fork.test_threadstest_androidtest_dbm_gnutest_devpolltest_epolltest_free_threadingtest_launchertest_msvcrttest_perf_profilertest_perfmapstest_startfiletest_winapitest_winconsoleiotest_winregtest_wmi11testsskipped (resourcedenied):
test_cursestest_peg_generatortest_pyrepltest_smtpnettest_socketservertest_tkintertest_ttktest_urllib2nettest_urllibnettest_winsoundtest_zipfile64442testsOK.
Totalduration: 20min5secTotaltests: run=44,347skipped=2,182Totaltestfiles: run=467/478skipped=25resource_denied=11Result: SUCCESS |
1st1
commented
Oct 15, 2024
@Eclips4 thanks for fixing the leak!
I sympathize, really sorry about breaking them and causing pain :/ Can we try landing this PR since it appears it should solve the issue? I'm afraid if we wait on this for a month to get it merged it will go stale and we just forget. I'd try again and if it fails we wait? If however you really don't want to do it, then fine. |
ambv
commented
Oct 15, 2024
Since we're about to release a1 tonight, I'd wait with landing this until right after a1. We won't forget about it. |
ambv
commented
Oct 15, 2024
Actually, @hugovk should make the call. |
hugovk
commented
Oct 15, 2024
Yeah, same call, thanks :) |
rhansen
left a comment
There was a problem hiding this comment.
Apologies for the breakage, and thank you for debugging!
Is a blurb required now that there's an API change between v3.14.0a1 and v3.14.0a2?
Also, would you mind fixing up the commit message, authorship info, etc. on the first commit:
git -c sequence.editor='sed -i -e "1s/^pick/edit/"' rebase -i main &&
git commit --amend -C 843d28f59d2 &&
git rebase --continueUh oh!
There was an error while loading. Please reload this page.
1st1
commented
Oct 16, 2024
Oh I was reading the schedule wrong. I didn't realize Victor wants to delay it just one day, essentially, I thought we were talking one month to merge this. Absolutely can wait a few days. |
hugovk
commented
Oct 16, 2024
Thanks, a1 is now out, merge whenever you're ready. |
vstinner
commented
Oct 16, 2024
Eclips4
commented
Oct 16, 2024
Sorry about that! I definitely will do it. |
…4776) Users want to know when the current context switches to a different context object. Right now this happens when and only when a context is entered or exited, so the enter and exit events are synonymous with "switched". However, if the changes proposed for pythongh-99633 are implemented, the current context will also switch for reasons other than context enter or exit. Since users actually care about context switches and not enter or exit, replace the enter and exit events with a single switched event. The former exit event was emitted just before exiting the context. The new switched event is emitted after the context is exited to match the semantics users expect of an event with a past-tense name. If users need the ability to clean up before the switch takes effect, another event type can be added in the future. It is not added here because YAGNI. I skipped 0 in the enum as a matter of practice. Skipping 0 makes it easier to troubleshoot when code forgets to set zeroed memory, and it aligns with best practices for other tools (e.g., https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Richard Hansen <rhansen@rhansen.org>
436edd2 to
049834cCompare@rhansen it seems I have done it. If you agree, I will merge it. (I'm actually do not understand why for |
vstinner
commented
Oct 16, 2024
GitHub is correct when saying:
|
ZeroIntensity
commented
Oct 16, 2024
Should this get tested with the refleak buildbots? |
vstinner
commented
Oct 16, 2024
I don't think so. I tested test_capi manually, and @Eclips4ran the whole test suite with |
…5532) Users want to know when the current context switches to a different context object. Right now this happens when and only when a context is entered or exited, so the enter and exit events are synonymous with "switched". However, if the changes proposed for pythongh-99633 are implemented, the current context will also switch for reasons other than context enter or exit. Since users actually care about context switches and not enter or exit, replace the enter and exit events with a single switched event. The former exit event was emitted just before exiting the context. The new switched event is emitted after the context is exited to match the semantics users expect of an event with a past-tense name. If users need the ability to clean up before the switch takes effect, another event type can be added in the future. It is not added here because YAGNI. I skipped 0 in the enum as a matter of practice. Skipping 0 makes it easier to troubleshoot when code forgets to set zeroed memory, and it aligns with best practices for other tools (e.g., https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum). Co-authored-by: Richard Hansen <rhansen@rhansen.org> Co-authored-by: Victor Stinner <vstinner@python.org>
test_capileaks references #125512📚 Documentation preview 📚: https://cpython-previews--125532.org.readthedocs.build/