[ 
https://issues.apache.org/jira/browse/MNG-7511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17565956#comment-17565956
 ] 

ASF GitHub Bot commented on MNG-7511:
-------------------------------------

kwart opened a new pull request, #767:
URL: https://github.com/apache/maven/pull/767

   JIRA: https://issues.apache.org/jira/browse/MNG-7511
   
   This PR ensures the `degreeOfConcurrency` is always a positive number 
(defaulting to `1`). It resolves issues when the computed value is less than 
zero.
   
   Following this checklist to help us incorporate your
   contribution quickly and easily:
   
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/MNG) filed
          for the change (usually before you start working on it).  Trivial 
changes like typos do not
          require a JIRA issue. Your pull request should address just this 
issue, without
          pulling in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[MNG-XXX] SUMMARY`, where you 
replace `MNG-XXX`
          and `SUMMARY` with the appropriate JIRA issue. Best practice is to 
use the JIRA issue
          title in the pull request title and in the first line of the commit 
message.
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean verify` to make sure basic checks pass. A more 
thorough check will
          be performed on your pull request automatically.
    - [ ] You have run the [Core IT][core-its] successfully.
   
   If your pull request is about ~20 lines of code you don't need to sign an
   [Individual Contributor License 
Agreement](https://www.apache.org/licenses/icla.pdf) if you are unsure
   please ask on the developers list.
   
   To make clear that you license your contribution under
   the [Apache License Version 2.0, January 
2004](http://www.apache.org/licenses/LICENSE-2.0)
   you have to acknowledge this by using the following check-box.
   
    - [x] I hereby declare this contribution to be licenced under the [Apache 
License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)
   
    - [ ] In any other case, please file an [Apache Individual Contributor 
License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   [core-its]: https://maven.apache.org/core-its/core-it-suite/
   




> Ensure the degreeOfConcurrency is a positive number in MavenExecutionRequest
> ----------------------------------------------------------------------------
>
>                 Key: MNG-7511
>                 URL: https://issues.apache.org/jira/browse/MNG-7511
>             Project: Maven
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 3.8.6
>            Reporter: Josef Cacek
>            Priority: Major
>
> The {{degreeOfConcurrency}} should always be a positive number, otherwise 
> builds might fail.
> In Hazelcast we build with threads set to {{-T 0.5C}} in 
> [{{.mvn/maven.config}}|https://github.com/hazelcast/hazelcast/blob/v5.1.2/.mvn/maven.config].
> This is fine until we run the build on a single CPU machine. It fails then 
> with {{IllegalArgumentException}} as the computed {{degreeOfConcurrency == 
> 0}}.
> Stacktrace from Maven 3.6.3:
> {code}
> [ERROR] IllegalArgumentException
> java.lang.IllegalArgumentException
>     at java.util.concurrent.ThreadPoolExecutor.<init> 
> (ThreadPoolExecutor.java:1293)
>     at java.util.concurrent.ThreadPoolExecutor.<init> 
> (ThreadPoolExecutor.java:1215)
>     at java.util.concurrent.Executors.newFixedThreadPool (Executors.java:155)
>     at 
> org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder.build
>  (MultiThreadedBuilder.java:88)
>     at org.apache.maven.lifecycle.internal.LifecycleStarter.execute 
> (LifecycleStarter.java:128)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
>     at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
>     at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
>     at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957)
>     at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289)
>     at org.apache.maven.cli.MavenCli.main (MavenCli.java:193)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>     at java.lang.reflect.Method.invoke (Method.java:566)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced 
> (Launcher.java:282)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.launch 
> (Launcher.java:225)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode 
> (Launcher.java:406)
>     at org.codehaus.plexus.classworlds.launcher.Launcher.main 
> (Launcher.java:347)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to