Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14529

Pipeline inconsistency due to mutable processors list

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Component/s: camel-base
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      The org.apache.camel.processor.Pipeline eagerly computes the size of the pipeline and converts the Processors to AsyncProcessors in construction. It also allows access to the processors field via List<Processor> getProcessors method, through which the list of processors in a pipeline can be mutated without recalculating the size or converting any added Processors to AsyncProcessors, leading to inconsistency.

      e.g. if I have code like:

      Pipeline pipeline = Pipeline.newInstance(context, processor1, processor2);
      pipeline.getProcessors().add(processor3);
      

      processor3 will never be executed.

      I see two possible solutions:

      1. disallow processors list mutation, or
      2. don't eagerly compute size and convert Processors to AsyncProcessors on demand

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              zregvart Zoran Regvart
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: