[Do not merge][PyROOT] Don't call `ClearProxiedObjects()` in hard shutdown mode
The old PyROOT (pre 2019) had a slightly different atexit handler than the new one. The hard shutdown mode is different: ClearProxiedObjects() is called before the final gROOT->EndOfProcessCleanups().
I had the impresstion that this is redundant, and indeed the old PyROOT didn't do it. This commit suggests to only call ClearProxiedObjects() in soft shutdown mode, in an attempt to avoid the frequent crashes seen at the end of PyROOT tutorials, especially on Ubuntu 24.10.
See also the original PRs where this functionality was introduced:
- https://github.com/root-project/root/pull/4687
- https://github.com/root-project/root/pull/4753
Just for extra context, note that there was a similar (albeit not equal) set of changes which spawned quite some discussion a while back https://github.com/root-project/root/pull/10753. Also, I would try to understand why we need all that extra bookeeping in the tutorials, I don't believe we should introduce those.
You are right, extra boilerplate in the tutorials is not good. But This PR is not meant to me merged as is, I did it to explore why ClearProxiedObjects() is needed also for hard shutdown.
And the set of code that I needed to add to the tutorials made to reason more or less clear: there is some issue with TH1 specifically.
Test Results
15 files 15 suites 3d 9h 49m 53s :stopwatch: 2 713 tests 2 712 :white_check_mark: 0 :zzz: 1 :x: 38 341 runs 38 340 :white_check_mark: 0 :zzz: 1 :x:
For more details on these failures, see this check.
Results for commit 8b960f75.
:recycle: This comment has been updated with latest results.
Superseded by #16837.