Bug 58336 - Race condition using presetdef with parallel
Summary: Race condition using presetdef with parallel
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.9.4
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-07 08:23 UTC by frank.wagner
Modified: 2015-09-07 08:30 UTC (History)
0 users



Attachments
Reproducing race condition with java and exec (2.33 KB, text/xml)
2015-09-07 08:23 UTC, frank.wagner
Details
A possible fix it is to 'clone' runtime configurables when applying preset. (7.32 KB, patch)
2015-09-07 08:30 UTC, frank.wagner
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description frank.wagner 2015-09-07 08:23:18 UTC
Created attachment 33070 [details]
Reproducing race condition with java and exec

There is a race condition when using presetdef with parallel.

Using presetdef to set an environment variable for java/exec tasks used in parallel will sometimes raise
"key and value must be specified for environment variables."

     [java] key and value must be specified for environment variables.
     [java] 	at org.apache.tools.ant.types.Environment$Variable.validate(Environment.java:128)
     [java] 	at org.apache.tools.ant.types.Environment$Variable.getContent(Environment.java:116)
     [java] 	at org.apache.tools.ant.types.Environment.getVariables(Environment.java:162)
     [java] 	at org.apache.tools.ant.taskdefs.Java.setupEnvironment(Java.java:835)
     [java] 	at org.apache.tools.ant.taskdefs.Java.setupExecutable(Java.java:826)
     [java] 	at org.apache.tools.ant.taskdefs.Java.fork(Java.java:788)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
     [java] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:497)
     [java] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] 	at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:453)
     [java] 	at java.lang.Thread.run(Thread.java:745)
Comment 1 frank.wagner 2015-09-07 08:30:56 UTC
Created attachment 33071 [details]
A possible fix it is to 'clone' runtime configurables when applying preset.