Add global type mutex for thread-safe type operations#7416
Add global type mutex for thread-safe type operations#7416youknowone wants to merge 11 commits intoRustPython:mainfrom
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…IMIZED in vectorcall fast path
…_cleanup frames, guard trace dispatch - Extract datastack_frame_size_bytes_for_code as free function, use it to compute init_cleanup stack bytes instead of hardcoded constant - Add monitoring_disabled_for_code to skip instrumentation for synthetic init_cleanup code object in RESUME and execute_instrumented - Add is_trace_event guard so profile-only events skip trace_func dispatch - Reformat core.rs (rustfmt)
Dropping values inside with_type_lock can trigger weakref callbacks, which may access attributes (LOAD_ATTR specialization) and re-acquire the non-reentrant type mutex, causing deadlock. Return old values from lock closures so they drop after lock release.
d0cfe84 to
1daba38
Compare
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] test: cpython/Lib/test/test_class.py (TODO: 16) dependencies: dependent tests: (no tests depend on class) Legend:
|
…ributeError - Use cls.set_attr() instead of cls.as_object().set_attr() in ctypes to ensure modified() is called and type cache stays valid - Add host_env feature to cron-ci.yaml for frozen_origname_matches test - Add stdio feature to cron-ci.yaml for encodings initialization - Fix __func__ AttributeError in custom_text_test_runner.py
Introduce vm.state.type_mutex to serialize type mutation and version-tag assignment, matching CPython's free-threading model.