<!-- 
RSS generated by JIRA (4.4#649-r158309) at Sun May 19 07:06:45 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-1104/CLJ-1104.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-1104] Concurrent with-redefs do not unwind properly, leaving a var permanently changed</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-1104</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;On 1.4 and latest master:&lt;/p&gt;

&lt;p&gt;user&amp;gt; (defn ten [] 10)&lt;br/&gt;
#&apos;user/ten&lt;br/&gt;
user&amp;gt; (doall (pmap #(with-redefs [ten (fn [] %)] (ten)) (range 20 100)))&lt;br/&gt;
(20 21 22 23 24 25 34 27 28 29 30 31 32 33 34 35 36 37 38 39 39 35 42 43 44 45 48 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 79 87 88 89 90 91 92 93 94 95 97 92 98 99)&lt;br/&gt;
user&amp;gt; (ten)&lt;br/&gt;
79&lt;/p&gt;

&lt;p&gt;Not sure if this is a bug per se, but the doc doesn&apos;t mention lack of concurrency safety and my expectation was that the original value would always be restored after any (arbitrarily interleaved) sequence of with-redefs calls. &lt;/p&gt;</description>
                <environment>Mac OS, Java 6</environment>
            <key id="15816">CLJ-1104</key>
            <summary>Concurrent with-redefs do not unwind properly, leaving a var permanently changed</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="1" iconUrl="http://dev.clojure.org/jira/images/icons/status_open.gif">Open</status>
                    <resolution id="-1">Unresolved</resolution>
                                <assignee username="-1">Unassigned</assignee>
                                <reporter username="jawolfe">Jason Wolfe</reporter>
                        <labels>
                    </labels>
                <created>Wed, 7 Nov 2012 17:46:19 -0600</created>
                <updated>Fri, 21 Dec 2012 23:05:10 -0600</updated>
                                    <version>Release 1.4</version>
                <version>Release 1.5</version>
                                <fixVersion>Approved Backlog</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29907" author="timmc" created="Wed, 7 Nov 2012 20:50:49 -0600"  >&lt;p&gt;The with-redefs doc (v1.4.0) says &quot;These temporary changes will be visible in all threads.&quot; That sounds non-thread-safe to me.&lt;/p&gt;

&lt;p&gt;In general, changes to var root bindings are not thread safe.&lt;/p&gt;</comment>
                    <comment id="29908" author="bendlas" created="Thu, 8 Nov 2012 09:17:31 -0600"  >&lt;p&gt;As I understand it, with-redefs is mainly used in test suites to mock out vars. It was introduced when vars became static by default and a lot of testsuites had been using binding for mocking. Maybe the docstring should be amended with something along the lines of: When using this you have to ensure that only a single thread is interacting with redef&apos;d vars.&lt;/p&gt;</comment>
                    <comment id="30030" author="stu" created="Sun, 25 Nov 2012 18:41:17 -0600"  >&lt;p&gt;Behavior find as is, doc string change would be fine.&lt;/p&gt;</comment>
                    <comment id="30032" author="jafingerhut" created="Sun, 25 Nov 2012 18:57:16 -0600"  >&lt;p&gt;Patch clj-1104-doc-unsafety-of-concurrent-with-redefs-v1.txt dated Nov 25 2012 updates doc string of with-redefs to make it clear that concurrent use is unsafe.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11708" name="clj-1104-doc-unsafety-of-concurrent-with-redefs-v1.txt" size="1091" author="jafingerhut" created="Sun, 25 Nov 2012 18:57:16 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10003">Vetted</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10001">Code</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                        </customfields>
    </item>
</channel>
</rss>