ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 41602] Ant jython attributes are not thread-safe
Date Mon, 09 Nov 2009 17:10:16 GMT

--- Comment #4 from valentino miazzo <> 2009-11-09 09:10:14 UTC
This bug affects also Javascript.

ANT script:

<target name="t13">
    <parallel failonany='false'>
        < key="one" />
        < key="two" />
        < key="three" />
        < key="four" />

<scriptdef name="" language="javascript">
    <attribute name="key" />
    var key = attributes.get("key");
    project.log("threadtest called with key: " + key);


threadtest called with key: four
threadtest called with key: four
threadtest called with key: two
threadtest called with key: three

Comment on results:

You can see that execution 'four' of overwrites the key parameter of
execution 'one'.


Each ScriptDef object as a single ScriptRunnerBase object. This runner is used
by any ScriptDefBase pointing to the ScriptDef.
When the same 'scripdef-ined' task is used inside a parallel task,  it creates
a race condition where beans of a ScriptDefBase overwrites the beans of another
ScriptDefBase .


I'm not an expert of the ANT codebase, so I cannot suggest a proper fix.
Anyway I have a quick an dirty patch that seems to fix the problem.

Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

View raw message