onnxruntime
0b02b9aa - Address review: GIL-safe logging callback, None-init, env guard, test

Commit
27 days ago
Address review: GIL-safe logging callback, None-init, env guard, test - Initialize the global callback to py::none() in the sink factory so the no-callback fast path is taken before any callback is set (a null handle is not None, so the previous code could invoke an empty callable). - Restructure PythonCallbackSink::SendImpl to acquire the GIL before copying or destroying the py::object, avoiding Python refcount mutation on non-Python worker threads. Lock order is GIL -> mutex consistently. - Only update default logger severity when installing a callback; resetting with None no longer silently overwrites a user-set severity. - Drop the unused err_msg in the exception handler. - Skip replacing the LoggingManager when a process-wide OrtEnv already existed (created outside Python) to avoid invalidating by existing sessions. - Assert the callback is actually invoked and validate record types in the test. - Reorder __init__.py import alphabetically; add trailing newline to header.
Author
Committer
Parents
Loading