Skip to content

[Do not merge][PyROOT] Don't call ClearProxiedObjects() in hard shutdown mode#16671

Closed
guitargeek wants to merge 4 commits intoroot-project:masterfrom
guitargeek:pyroot_shutdown
Closed

[Do not merge][PyROOT] Don't call ClearProxiedObjects() in hard shutdown mode#16671
guitargeek wants to merge 4 commits intoroot-project:masterfrom
guitargeek:pyroot_shutdown

Conversation

@guitargeek
Copy link
Copy Markdown
Contributor

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:

@vepadulano
Copy link
Copy Markdown
Member

Just for extra context, note that there was a similar (albeit not equal) set of changes which spawned quite some discussion a while back #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.

@guitargeek
Copy link
Copy Markdown
Contributor Author

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.

@guitargeek guitargeek force-pushed the pyroot_shutdown branch 3 times, most recently from 47ce08e to 6d529a4 Compare October 14, 2024 10:16
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 14, 2024

Test Results

    15 files      15 suites   3d 9h 49m 53s ⏱️
 2 713 tests  2 712 ✅ 0 💤 1 ❌
38 341 runs  38 340 ✅ 0 💤 1 ❌

For more details on these failures, see this check.

Results for commit 8b960f7.

♻️ This comment has been updated with latest results.

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:

  * root-project#4687
  * root-project#4753
By default, ROOT manages all TF1 instances automatically, so this new
pythonization is dropping the ownership on the Python side.
They are not necessary anymore after the commit that avoids calling
`ClearProxiedObjects()` in hard shutdown mode.
@dpiparo dpiparo changed the title [PyROOT] Don't call ClearProxiedObjects() in hard shutdown mode [Do not merge][PyROOT] Don't call ClearProxiedObjects() in hard shutdown mode Oct 15, 2024
@guitargeek
Copy link
Copy Markdown
Contributor Author

Superseded by #16837.

@guitargeek guitargeek closed this Nov 7, 2024
@guitargeek guitargeek deleted the pyroot_shutdown branch November 7, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants