Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix data race with the read/write of lastDownTime_
Summary: Fixes the following TSAN data race - ``` Write of size 8 at 0x7b8400009888 by thread T40 (mutexes: write M507916304074681368, read M61215687833552496): #0 facebook::fboss::QsfpModule::markLastDownTime() fboss/qsfp_service/module/QsfpModule.cpp:951 (qsfp_service+0x206ea68) #1 facebook::fboss::TransceiverManager::markLastDownTime(facebook::fboss::TransceiverID) fboss/qsfp_service/TransceiverManager.cpp:1279 (qsfp_service+0x2143c4a) #2 void facebook::fboss::markLastDownTime_impl::operator()<facebook::fboss::ALL_PORTS_DOWN_helper Previous read of size 8 at 0x7b8400009888 by thread T75 (mutexes: read M61215687833552496, write M401237648678623312): #0 facebook::fboss::QsfpModule::shouldRemediateLocked() fboss/qsfp_service/module/QsfpModule.cpp:649 (qsfp_service+0x206dbeb) #1 facebook::fboss::QsfpModule::shouldRemediate()::$_36::operator()() const fboss/qsfp_service/module/QsfpModule.cpp:590 (qsfp_service+0x20722b0) #2 facebook::fboss::QsfpModule::shouldRemediate() fboss/qsfp_service/module/QsfpModule.cpp:596 (qsfp_service+0x20722b0) #3 facebook::fboss::TransceiverManager::triggerRemediateEvents(std::vector<facebook::fboss::TransceiverID, std::allocator<facebook::fboss::TransceiverID> > const&) fboss/qsfp_service/TransceiverManager.cpp:1257 (qsfp_service+0x212d79a) #4 facebook::fboss::TransceiverManager::refreshStateMachines() fboss/qsfp_service/TransceiverManager.cpp:978 (qsfp_service+0x2142a52) ``` Reviewed By: rajank7 Differential Revision: D43183960 Privacy Context Container: L1125642 fbshipit-source-id: 9169d1ea2f03db86cbfa20b9f3e615b0871ea2ec
- Loading branch information