Github user phrocker commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/74#discussion_r109792063
--- Diff: libminifi/src/provenance/ProvenanceRepository.cpp ---
@@ -36,6 +36,7 @@ void ProvenanceRepository::run() {
uint64_t curTime = getTimeMillis();
uint64_t size = repoSize();
if (size >= purgeThreshold) {
+ std::lock_guard<std::mutex> lock(mutex_);
--- End diff --
If LevelDB is thread safe and is being picked up that means at that moment
in the thread which picks it it is not eligible to be purged and is eligible to
be sent. That means you can atomically remove said item and thread A will never
get it to send OR lock all access. If you need locking here above LevelDB we
should change the access pattern.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---