[MNG-5750] Sporadic failures in concurrent build
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[Alexander Ashitkin](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=alex_ashitkin)** opened **[MNG-5750](https://issues.apache.org/jira/browse/MNG-5750?redirect=false)** and commented
We have a large project of 300+ modules which regularly fails with different kind of errors in different places. The issue is reliably reproduced with parallel build and is not happens in single threaded. The optimal concurrency level for our project ~10 threads. At this level ~%20 of builds fail. To workaround the issue we reduced concurrency to 4 in development builds and reverted production build to 1 thread.
Main point of failures:
1. Surefire ClassNotFound. Reported and investigated in SUREFIRE-1132. Points to a problem with MavenProject#getArtifacts - empty set unexpectedly returned.
2. Compiler - unexpected failure because of incorrect classpath (literally all dependencies are not on the classpath), like:
```
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[3,30] package ... does not exist
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[4,30] package ... does not exist
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[8,25] package ... does not exist
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[9,21] package org.joda.time does not exist
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[11,37] package com.google.common.base does not exist
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[11,1] static import only from classes and interfaces
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[12,37] package com.google.common.base does not exist
20:20:54 [ERROR] /D:/jenkins/work/workspace/..Request.java:[12,1] static import only from classes and interfaces
```
1. Jar - unexpected NPE. Reported with stack traces in MJAR-192. (assembly plusgin seems to be also affected)
At this point the issue looks like problem with MavenProject#getArtifacts in concurrent builds.
To help with the issue im happy to implement or evaluate any custom assembly to trace this down. Unfortunately i cannot submit my project - it is proprietary.
Thanks in advance, Alexander
---
**Affects:** 3.1.1, 3.2.1, 3.2.2, 3.2.5
**Issue Links:**
- [MNG-5960](https://issues.apache.org/jira/browse/MNG-5960) MojoExecutor overriding resolved artifacts of concurrently built MavenProject
- [MNG-5700](https://issues.apache.org/jira/browse/MNG-5700) Update to plexus-interpolation 1.21 to avoid potential thread safety problems
- [MJAR-192](https://issues.apache.org/jira/browse/MJAR-192) Sporadic NPE in maven-jar-plugin:2.5:jar
(_**"is depended upon by"**_)
- [SUREFIRE-1132](https://issues.apache.org/jira/browse/SUREFIRE-1132) Surefire: regular isolated classloader failures in parallelbuild
(_**"is depended upon by"**_)
**Backported to:** waiting-for-feedback
4 votes, 15 watchers
Contributor guide
Research direction
Start by reproducing the reported failures with a parallel Maven build at about 10 threads, comparing them with a single-threaded build. Trace MavenProject#getArtifacts and review the linked MNG-5960, MNG-5700, MJAR-192, and SUREFIRE-1132 investigations. Done means the concurrent build no longer produces the reported missing artifacts, incorrect classpaths, or jar-plugin NPEs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100