Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-543

maven-doxia-markdown fails in parallel builds

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7
    • 1.8
    • Module - Markdown
    • None

    Description

      The PegDownProcessor used at https://github.com/apache/maven-doxia/blob/doxia-1.7/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java#L72 is shared between multiple concurrent executions of the maven-site-plugin.

      This leads to random errors (NPEs, ClassCastException) because the parser state machine is reused by multiple threads.

      It seem not to be enough to make the field non-static since the whole MarkdownParser instance seem to be shared between different threads.

      The PegDown Javadoc explicitly states that a PegDownProcessor is not thread-safe: https://github.com/sirthias/pegdown/blob/master/src/main/java/org/pegdown/PegDownProcessor.java

      Possible solutions:

      • Put the PegDownProcessor into a threadLocal.
      • Instanciate the PegDownProcessor in the toHtml method.

      Attachments

        Activity

          People

            michael-o Michael Osipov
            dwegener Daniel Wegener
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified