Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7536

Mojo execution locking in Maven 3.8.5 deadlocks my plugin

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Information Provided
    • 3.8.5, 3.8.6
    • None
    • None
    • None

    Description

      I have an existing mojo which stopped working in Maven 3.8.5 but had been working for years.  It looks like MNG-7156 is the cause.

      This mojo looks through its dependencies for other reactor projects, then looks at those projects for any plugin executions with a special phase name.  For all found executions, it executes them in a thread pool as part of some other processing it is doing.

      My plugin is proprietary and I am unable to share it, but I am able to share a much smaller example illustrating the problem.

      Being example code, it just spawns a thread to run the mojo executions and attempts to join the thread.  In the real code all executions for a given project will run sequentially on one thread, but each project's work will be scheduled concurrently on a thread pool.

      I didn't feel it was necessary to use a thread pool and schedule more than one project's executions for this example.  The deadlock will occur simply by running any mojo at all on a secondary thread while the calling thread is running a mojo waiting for that secondary thread to complete.

      Attachments

        1. thread-example.tar.gz
          5 kB
          David Elliott

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              dfelliott David Elliott
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: