You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/12/04 15:13:19 UTC

[GitHub] [nifi] belugabehr commented on a change in pull request #3915: NIFI-6926: Fixed memory leak in NiFiAtlasHook

belugabehr commented on a change in pull request #3915: NIFI-6926: Fixed memory leak in NiFiAtlasHook
URL: https://github.com/apache/nifi/pull/3915#discussion_r353801287
 
 

 ##########
 File path: nifi-nar-bundles/nifi-atlas-bundle/nifi-atlas-reporting-task/src/main/java/org/apache/nifi/atlas/hook/NiFiAtlasHook.java
 ##########
 @@ -55,14 +55,23 @@ public void addMessage(HookNotificationMessage message) {
     }
 
     public void commitMessages() {
-        final NotificationSender notificationSender = new NotificationSender();
+        final NotificationSender notificationSender = createNotificationSender();
         notificationSender.setAtlasClient(atlasClient);
         notificationSender.send(messages, this::notifyEntities);
+        messages.clear();
 
 Review comment:
   The fact that the `send` method accepts a function makes me think that the send happens asynchronously.  Are you sure that `send` is a blocking method?  If not, clearing the messages will cause a ConcurrentModificationException

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services