The Wayback Machine - https://web.archive.org/web/20220413052502/https://github.com/pythonnet/pythonnet/pull/1623
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to detect whether the clr module is partially initialised #1623

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Copy link
Member

@filmor filmor commented Nov 29, 2021

This should fix issue #1582. While the respective behaviour (setting the member value _initializing) is not documented, it has been that way since at least 3.4. As we control clr, it can also not happen, that the value is accidentally set.

What does this implement/fix? Explain your changes.

...

Does this close any currently open issues?

...

Any other comments?

...

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

This should fix issue #1582. While the respective behaviour (setting the
member value `_initializing`) is not documented, it has been that way since
at least 3.4. As we control `clr`, it can also not happen, that the value
is accidentally set.
@lostmsu
Copy link
Member

@lostmsu lostmsu commented Nov 29, 2021

Do you know how to reproduce the original issue? Can you confirm you tried with and without the fix, and it at least seems not to repro with the fix?

@filmor
Copy link
Member Author

@filmor filmor commented Nov 29, 2021

Nope. I just read the Python source code, and it's clear how exactly this can happen. There is however no public interface to check for this situation, so apart from this hacky version, we are out of luck anyhow.

@lostmsu
Copy link
Member

@lostmsu lostmsu commented Nov 29, 2021

I don't see any code that would set that _initializing property. Is it set implicitly somehow?

@filmor
Copy link
Member Author

@filmor filmor commented Nov 29, 2021

@lostmsu
Copy link
Member

@lostmsu lostmsu commented Nov 29, 2021

@filmor do you have a good theory why this could happen during shutdown then? The original bug speaks about shutdown scenario.

@filmor
Copy link
Member Author

@filmor filmor commented Nov 30, 2021

It must be that the module is gone and some code (the loader?) tries to reinitialise it, races with the initialisation and hits this bump.

@filmor
Copy link
Member Author

@filmor filmor commented Dec 19, 2021

@lostmsu What do you think about this PR?

@lostmsu
Copy link
Member

@lostmsu lostmsu commented Dec 19, 2021

@filmor I am not convinced unless we have a repro.

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

2 participants