adamdebreceni commented on a change in pull request #1191:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1191#discussion_r724028434
##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -388,6 +389,12 @@ void ConsumeWindowsEventLog::onTrigger(const
std::shared_ptr<core::ProcessContex
return;
}
+ std::unique_lock<std::mutex> lock(on_trigger_mutex_, std::try_to_lock);
Review comment:
we might even need to move this to the top of onTrigger as the
`bookmark_` is being read without synchronization (this is not new)
##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -432,6 +439,7 @@ void ConsumeWindowsEventLog::onTrigger(const
std::shared_ptr<core::ProcessContex
}
wel::WindowsEventLogHandler ConsumeWindowsEventLog::getEventLogHandler(const
std::string & name) {
+ std::lock_guard<std::mutex> lock(cache_mutex_);
Review comment:
we might be able to remove this `cache_mutex_` as this seems to be the
only place it's used, and here we are already protected by the
`on_trigger_mutex_`
although I'm also fine with leaving it as is, and investigating these
mutexes in a separate PR
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]