Lehel44 commented on a change in pull request #4748:
URL: https://github.com/apache/nifi/pull/4748#discussion_r566892972
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-runtime/src/main/java/org/apache/nifi/BootstrapListener.java
##########
@@ -46,6 +46,7 @@
private volatile Listener listener;
private volatile ServerSocket serverSocket;
Review comment:
I know this is not your modification but this one is interesting, so
just pointing out: objects shouldn't be marked volatile. "Marking a mutable
object field volatile means the object reference is volatile but the object
itself is not, and other threads may not see updates to the object state... For
mutable objects, the volatile should be removed, and some other method should
be used to ensure thread-safety, such as synchronization, or ThreadLocal
storage."
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]