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

PublishJMS can fail with ConcurrentModificationException

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.11.0
    • Component/s: Extensions
    • Labels:
      None

      Description

      PublishJMS tries to cleanup flowfile attributes before sending them over JMS.

      However it does so via iterating over the entries of a Map and removing unwanted ones - within the same iteration cycle:

                          for (final Map.Entry<String,String> entry : attributesToSend.entrySet()) {
                              if (!entry.getKey().endsWith(".type")){
                                  if (entry.getKey().contains("-") || entry.getKey().contains(".")) {
                                      attributesToSend.remove(entry.getKey());
                                  }
                              }
                          }
      

      This is undetermenistic and should not be done as can lead to ConcurrentModificationException.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tpalfy Tamas Palfy
                Reporter:
                tpalfy Tamas Palfy
              • 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 - 0.5h
                  0.5h