This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit dc94061d843db200a8f634333515a8c997050557
Author: Adam Debreceni <[email protected]>
AuthorDate: Wed Mar 29 06:07:09 2023 +0200

    MINIFICPP-2085 Clear stale processor controller cache on flow update
    
    The agent crashed on flow update if the flow contained processors with
    the same id as the previous flow
    
    Closes #1542
    Signed-off-by: Marton Szasz <[email protected]>
---
 libminifi/src/RootProcessGroupWrapper.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libminifi/src/RootProcessGroupWrapper.cpp 
b/libminifi/src/RootProcessGroupWrapper.cpp
index ee6f5e84c..f36667d6c 100644
--- a/libminifi/src/RootProcessGroupWrapper.cpp
+++ b/libminifi/src/RootProcessGroupWrapper.cpp
@@ -54,12 +54,14 @@ void 
RootProcessGroupWrapper::setNewRoot(std::unique_ptr<core::ProcessGroup> new
   if (metrics_publisher_store_) { 
metrics_publisher_store_->clearMetricNodes(); }
   backup_root_ = std::move(root_);
   root_ = std::move(new_root);
+  processor_to_controller_.clear();
   if (metrics_publisher_store_) { 
metrics_publisher_store_->loadMetricNodes(root_.get()); }
 }
 
 void RootProcessGroupWrapper::restoreBackup() {
   if (metrics_publisher_store_) { 
metrics_publisher_store_->clearMetricNodes(); }
   root_ = std::move(backup_root_);
+  processor_to_controller_.clear();
   if (metrics_publisher_store_) { 
metrics_publisher_store_->loadMetricNodes(root_.get()); }
 }
 

Reply via email to