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

Standard Http Context Map not cleaned

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 0.6.1
    • Fix Version/s: 1.0.0, 0.7.0, 1.0.0-Beta
    • Component/s: Extensions
    • Labels:
      None

      Description

      The controller service StandardHttpContextMap provides the ability to store and retrieve HTTP requests and responses external to a processor, so that multiple processors can interact with the same HTTP request.

      In this controller, a timeout is defined to clean the context map in case requests have not been answered after a given threshold. The cleanup process is scheduled every timeout / 2 as runnable task. However "If any execution of the task encounters an exception, subsequent executions are suppressed."

      The problem is located here:

                          try {
                              final AsyncContext async = entry.getValue().getAsync();
                              ((HttpServletResponse) async.getResponse()).sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
                              async.complete();
                          } catch (final IOException ioe) {
                              // we are trying to indicate that we are unavailable. If we have an IOException and cannot respond,
                              // then so be it. Nothing to really do here.
                          }
      

      The sendError method can throw IllegalStateException in some situations "if the response was committed before this method call". If such an error is thrown the task will be never scheduled again and the map never cleaned.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pvillard Pierre Villard
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: