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

ASF GitHub Bot commented on HADOOP-19011:
-----------------------------------------

adoroszlai opened a new pull request, #6353:
URL: https://github.com/apache/hadoop/pull/6353

   ## What changes were proposed in this pull request?
   
   Fix:
   
   ```
   ConcurrentModificationException
       at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1013)
       at java.util.ArrayList$Itr.next (ArrayList.java:967)
       at org.apache.hadoop.maven.plugin.util.Exec.run (Exec.java:77)
       at org.apache.hadoop.maven.plugin.util.Exec.run (Exec.java:52)
       at 
org.apache.hadoop.maven.plugin.versioninfo.VersionInfoMojo.determineSCM 
(VersionInfoMojo.java:115)
       at org.apache.hadoop.maven.plugin.versioninfo.VersionInfoMojo.execute 
(VersionInfoMojo.java:80)
       at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo 
(DefaultBuildPluginManager.java:137)
   ```
   
   which is possible if the process exits with error:
   
   ```
   [INFO] -

> Possible ConcurrentModificationException if Exec command fails
> --------------------------------------------------------------
>
>                 Key: HADOOP-19011
>                 URL: https://issues.apache.org/jira/browse/HADOOP-19011
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Attila Doroszlai
>            Assignee: Attila Doroszlai
>            Priority: Major
>
> {{ConcurrentModificationException}} may happen in:
> {code:title=https://github.com/apache/hadoop/blob/19b9e6a97b8faa0eb48e7b1855ab37e6d4b6c2a9/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/util/Exec.java#L64-L82}
>   public int run(List<String> command, List<String> output,
>       List<String> errors) {
>     int retCode = 1;
>     ProcessBuilder pb = new ProcessBuilder(command);
>     try {
>       Process p = pb.start();
>       OutputBufferThread stdOut = new OutputBufferThread(p.getInputStream());
>       OutputBufferThread stdErr = new OutputBufferThread(p.getErrorStream());
>       stdOut.start();
>       stdErr.start();
>       retCode = p.waitFor();
>       if (retCode != 0) {
>         mojo.getLog().warn(command + " failed with error code " + retCode);
>         for (String s : stdErr.getOutput()) {
>           mojo.getLog().debug(s);
>         }
>       }
>       stdOut.join();
>       stdErr.join();
> {code}
> due to accessing {{stdErr.getOutput()}} before {{stdErr}} thread stops.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to