Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5085

InvokeHttp does not close the response in all cases

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.0, 1.5.0, 1.6.0
    • Fix Version/s: 1.7.0
    • Component/s: None
    • Labels:
      None

      Description

      As stated in this github issue for OkHttp[1] (the library InvokeHttp uses), the response needs to be closed for every instance of the response. InvokeHttp currently only closes the underlying body stream in the instance of there existing a body[2][3]. The proper way to do it is how the HttpNotificationService does, utilizing a try with resources on the response[4]

       

      I ran into this issue when my 1.5.0 instance hit OOM errors multiple times. I'm still not a 100% sure this is the root cause but one common thing between those OOM errors is repeated socket timeout exceptions in InvokeHttp (and even if it's not, it should still be fixed).

       

      [1] https://github.com/square/okhttp/issues/2311 
      [2] https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java#L822 
      [3] https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java#L894 
      [4] https://github.com/apache/nifi/blob/master/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/notification/http/HttpNotificationService.java#L230

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                JPercivall Joseph Percivall
                Reporter:
                JPercivall Joseph Percivall
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: