Conversation
…S-178976_rh_python312
dtrawins
reviewed
Jan 14, 2026
| @@ -1,37 +0,0 @@ | |||
| #***************************************************************************** | |||
Collaborator
Author
There was a problem hiding this comment.
Not used anywhere.
Co-authored-by: Trawinski, Dariusz <dariusz.trawinski@intel.com>
mzegla
reviewed
Jan 14, 2026
| std::unique_ptr<PythonBackend> pythonBackend; | ||
| mutable std::unique_ptr<py::gil_scoped_release> GILScopedRelease; | ||
| std::thread::id threadId; | ||
| bool hasModuleInitializedTheInterpreter; |
Collaborator
There was a problem hiding this comment.
A bit shorter option
Suggested change
| bool hasModuleInitializedTheInterpreter; | |
| bool ownsInterpreter; |
Comment on lines
+80
to
+82
| // No need to release GIL it must be handled with the initialize interpreter class. Currently in gtest PythonEnvironment. | ||
| if (!hasModuleInitializedTheInterpreter) | ||
| return; |
Collaborator
There was a problem hiding this comment.
IMHO the comment does not bring too much context and unnecessarily gives information about testing - it's not bound. I also don't think this logic should be here. Can you move such check to the place this method is used - server.cpp and go with something like:
auto pythonModule = dynamic_cast<const PythonInterpreterModule*>(it->second.get());
if(pythonModule->ownsInterpreter()) {
// Natively GIL is held by the thread that initialized interpreter, so we only need to release it, if we own the interpreter.
// If it was initialized externally, then the external thread shall release the GIL before launching that module.
pythonModule->releaseGILFromThisThread();
}
dtrawins
approved these changes
Jan 15, 2026
mzegla
approved these changes
Jan 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary
Changing redhat core python from 3.9 to 3.12
3.9 still required for tensorflow compilation.
🧪 Checklist
``