Repository navigation
Tags
Tags
Fix issue plasma-umass#1022: pytest-xdist + --profile-all on Linux dr… …opped user samples (plasma-umass#1055) execnet worker subprocesses spawned by pytest-xdist inherited a sigmask with Scalene's CPU sampling signal blocked. The parent's patch_module_functions_with_signal_blocking shim (added for issue plasma-umass#841) wraps every os.* call with pthread_sigmask(SIG_BLOCK, [SIGALRM]); when that wrapper intersects subprocess.Popen's fork window, the child inherits the blocked mask. setitimer fires every 10 ms, but the kernel keeps the signal pending and the handler never runs — workers collect zero CPU and zero allocation samples, each prints "did not run for long enough", and the user's source file is absent from the merged profile. Fix in enable_signals(): unconditionally pthread_sigmask(SIG_UNBLOCK, ...) Scalene's profiling signals in the calling (main) thread so children clear any inherited block before the timer starts. Adds a Linux-only smoketest that runs --profile-all with -n 2 xdist workers against a CPU-busy fixture and asserts the user file ends up in the profile. Pre-fix the smoketest exits 1 with the exact warning the bug reporter saw; post-fix it passes. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Merge branch 'master' of https://github.com/plasma-umass/scalene
Bump version to 2.0.1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Refactor scalene_profiler.py into modular components (plasma-umass#967) * Refactor scalene_profiler.py into modular components Extract separation of concerns from the main profiler: - ScaleneCPUProfiler: CPU sample processing logic - ScaleneTracing: File/function filtering with lru_cache - ScaleneLifecycle: Profiler lifecycle management Updates: - Reduce scalene_profiler.py from ~1885 to ~1584 lines - Use Filename type consistently across tracing APIs - Update scalene_tracer.py type signatures - Document new modules in scalene/README.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix mypy error for Python 3.9 compatibility Add unused-ignore to type comment for IPython.get_ipython() call to handle both Python versions that do and don't flag this. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
PreviousNext