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

InputStreamCache is not thread-safe

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.4.3, 4.6.0
    • 4.7.0
    • camel-core
    • None
    • Unknown

    Description

      InputStreamCache is reset after each step (org.apache.camel.impl.engine.CamelInternalProcessor.StreamCachingAdvice#after), and if there are two threads processing the same InputStreamCache (e.g. Seda), there may be a case where one thread invokes InputStreamCache#reset (org.apache.camel.support.MessageHelper#resetStreamCache) while another thread converts this InputStreamCache to String (org.apache.camel.util.IOHelper#toString(java.io.BufferedReader, long). It leads to java.io.ByteArrayInputStream#pos being reset and the target String having duplicate entries.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bartoszpop Bartosz Popiela
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: