NissimShiman commented on code in PR #6059:
URL: https://github.com/apache/nifi/pull/6059#discussion_r877371995


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core-api/src/main/java/org/apache/nifi/controller/AbstractComponentNode.java:
##########
@@ -591,7 +592,10 @@ public void refreshProperties() {
         // use setProperty instead of setProperties so we can bypass the class 
loading logic.
         // Consider value changed if it is different than the 
PropertyDescriptor's default value because we need to call the 
#onPropertiesModified
         // method on the component if the current value is not the default 
value, since the component itself is being reloaded.
-        for (final Map.Entry<PropertyDescriptor, PropertyConfiguration> entry 
: this.properties.entrySet()) {
+        // Also, create a copy of this.properties instead of iterating 
directly over this.properties since the call to setProperty can change the
+        // underlying map, and the behavior of modifying the map while 
iterating over its elements is undefined.

Review Comment:
   nice catch



##########
nifi-system-tests/nifi-system-test-suite/src/test/java/org/apache/nifi/tests/system/NiFiSystemIT.java:
##########
@@ -116,6 +118,12 @@ public void teardown() throws Exception {
 
             if (isDestroyEnvironmentAfterEachTest()) {
                 cleanup();
+            } else if (destroyFlowFailure != null) {
+                // If unable to destroy the flow, we need to shutdown the 
instance and delete the flow and completely recreate the environment.
+                // Otherwise, we will be left in an unknown state for the next 
test, and that can cause cascading failures that are very difficult
+                // to understand and troubleshoot.
+                logger.info("Because there was a failure when destroying the 
flow, will completely tear down the environments and start with a clean 
environment for the next test.");
+                cleanup();

Review Comment:
   and another very nice catch



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to