Skip to content

Commit 6069545

Browse files
Fix ThreadSanitizer data race in get_total_connection_errors
The ThreadSanitizer detected a data race where the main thread was reading m_connection_errors from m_cur_stats and m_stats list while worker threads were modifying them. Fixed by: 1. Making get_total_connection_errors() read only from m_totals (similar to get_total_ops(), get_total_bytes(), etc.) 2. Adding totals::update_connection_error() method to update m_totals.m_connection_errors incrementally 3. Calling m_totals.update_connection_error() from run_stats::update_connection_error() This ensures m_totals.m_connection_errors is updated atomically and can be safely read from the main thread without data races.
1 parent f27fdbd commit 6069545

File tree

4 files changed

+21386
-8
lines changed

4 files changed

+21386
-8
lines changed

0 commit comments

Comments
 (0)