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

MergeRecord does not work in stateless flows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.16.0
    • Extensions

    Description

      The stateless runtime triggers a processor up until FFs are available in the upstream queue.

      MergeRecord needs an extra onTrigger() call where session.get() yields no result in order to get notified that no more FFs are available and it is time to send the merged FF downstream. This extra call will never happen in stateless environment and MergeRecord cannot send out FF in this way.

      Modify MergeRecord to run session.get() in a loop within a single onTrigger() call like MergeContent does:

      while (binManager.getBinCount() <= context.getProperty(MAX_BIN_COUNT).asInteger()) {
          if (!isScheduled()) {
              break;
          }
      
          final ProcessSession session = sessionFactory.createSession();
          final List<FlowFile> flowFiles = session.get(1000);
          if (flowFiles.isEmpty()) {
              break;
          }
          ... 
      

      NIFI-9390 also affects MergeContent when it is not in the starting position in the flow but this jira needs to be fixed first (otherwise the other cannot pop up).

      Attachments

        Issue Links

          Activity

            People

              turcsanyip Peter Turcsanyi
              turcsanyip Peter Turcsanyi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m