Fix 2 race conditions detected with TSan, one in CobraMetricsPublisher::push and another one in WebSocketTransport::sendData (that one was bad).
This commit is contained in:
@ -462,6 +462,8 @@ namespace ix
|
||||
const Json::Value& msg,
|
||||
bool addToQueue)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_prePublishMutex);
|
||||
|
||||
invokePublishTrackerCallback(true, false);
|
||||
|
||||
CobraConnection::MsgId msgId = _id;
|
||||
|
@ -181,6 +181,7 @@ namespace ix
|
||||
Json::Value _pdu;
|
||||
Json::FastWriter _jsonWriter;
|
||||
mutable std::mutex _jsonWriterMutex;
|
||||
std::mutex _prePublishMutex;
|
||||
|
||||
/// Traffic tracker callback
|
||||
static TrafficTrackerCallback _trafficTrackerCallback;
|
||||
|
Reference in New Issue
Block a user