Summary
Bound session parsing concurrency in load_session_files and preserve per-file reporting when a worker panics.
Rationale
The current implementation in crates/sivtr-core/src/query/mod.rs creates one scoped thread per session file. Workspaces with many session files can oversubscribe CPU resources, increase peak memory use, or reach host thread limits. A panic during JoinHandle::join() can also stop the full load instead of reporting the affected session as skipped.
Required changes
- Limit parsing workers to
std::thread::available_parallelism(), with a safe fallback of one worker.
- Distribute session-file tasks across the bounded worker set.
- Continue processing other session files if one worker panics.
- Mark every task from a panicking worker as a
SkippedSession with the error text parse worker panicked.
- Do not use
unwrap() in production code.
Affected area
crates/sivtr-core/src/query/mod.rs
load_session_files
Acceptance criteria
- The number of parsing threads does not exceed the selected worker limit.
- Normal session-file outcomes retain their existing ordering.
- A worker panic does not abort the complete workspace load.
- Each session file not completed because of a worker panic appears in
QueryResult::skipped.
- Relevant tests and strict Clippy checks pass.
Backlinks
Summary
Bound session parsing concurrency in
load_session_filesand preserve per-file reporting when a worker panics.Rationale
The current implementation in
crates/sivtr-core/src/query/mod.rscreates one scoped thread per session file. Workspaces with many session files can oversubscribe CPU resources, increase peak memory use, or reach host thread limits. A panic duringJoinHandle::join()can also stop the full load instead of reporting the affected session as skipped.Required changes
std::thread::available_parallelism(), with a safe fallback of one worker.SkippedSessionwith the error textparse worker panicked.unwrap()in production code.Affected area
crates/sivtr-core/src/query/mod.rsload_session_filesAcceptance criteria
QueryResult::skipped.Backlinks