Scope
refactron/core/refactron.py — analyze() parallel branch
refactron/core/config.py — use_multiprocessing: bool = False (threading default)
refactron/core/parallel.py — ThreadPoolExecutor
Problem
With default threading, process_file_wrapper appends to result.semantic_skip_warnings from multiple workers. CPython list append is not guaranteed safe under concurrent modification; this can cause lost updates or rare corruption under load.
Suggested direction
- Return skip warnings from
process_func and merge in the main thread after process_files completes; or use a threading.Lock around appends; or use a queue.
Acceptance
- No shared mutable
AnalysisResult fields mutated from worker threads; stress test optional.
Scope
refactron/core/refactron.py—analyze()parallel branchrefactron/core/config.py—use_multiprocessing: bool = False(threading default)refactron/core/parallel.py—ThreadPoolExecutorProblem
With default threading,
process_file_wrapperappends toresult.semantic_skip_warningsfrom multiple workers. CPython listappendis not guaranteed safe under concurrent modification; this can cause lost updates or rare corruption under load.Suggested direction
process_funcand merge in the main thread afterprocess_filescompletes; or use athreading.Lockaround appends; or use a queue.Acceptance
AnalysisResultfields mutated from worker threads; stress test optional.