<!--
RSS generated by JIRA (4.4#649-r158309) at Tue May 21 19:56:58 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/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+NREPL+AND+fixVersion+%3D+%220.2.0%22+AND+resolution+in+(Completed%2C+Declined%2C+Duplicate)&tempMax=1000&field=key&field=summary
-->
<!-- If you wish to do custom client-side styling of RSS, uncomment this:
<?xml-stylesheet href="http://dev.clojure.org/jira/styles/jiraxml2html.xsl" type="text/xsl"?>
-->
<rss version="0.92">
    <channel>
        <title>Clojure JIRA</title>
        <link>http://dev.clojure.org/jira/secure/IssueNavigator.jspa?reset=true&amp;jqlQuery=project+%3D+NREPL+AND+fixVersion+%3D+%220.2.0%22+AND+resolution+in+%28Completed%2C+Declined%2C+Duplicate%29</link>
        <description>An XML representation of a search request</description>
                <language>en-us</language>
                        <issue start="0" end="11" total="11"/>
                <build-info>
            <version>4.4</version>
            <build-number>649</build-number>
            <build-date>25-07-2011</build-date>
        </build-info>
<item>
            <title>[NREPL-35] Eliminate several uses of reflection in tools.nrepl</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-35</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;There are several uses of reflection in tools.nrepl that can be eliminated with suitable type hints.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15797">NREPL-35</key>
            <summary>Eliminate several uses of reflection in tools.nrepl</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="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="jafingerhut">Andy Fingerhut</reporter>
                        <labels>
                    </labels>
                <created>Sun, 28 Oct 2012 22:11:08 -0500</created>
                <updated>Wed, 31 Oct 2012 04:44:06 -0500</updated>
                    <resolved>Wed, 31 Oct 2012 04:44:06 -0500</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29861" author="jafingerhut" created="Sun, 28 Oct 2012 22:12:37 -0500"  >&lt;p&gt;nrepl-35-eliminate-reflection-v1.txt dated Oct 28 2012 adds type hints to eliminate some of the reflection warnings in tools.nrepl.  There are still some left over that are not as obvious how to eliminate, if it is even possible.&lt;/p&gt;</comment>
                    <comment id="29877" author="cemerick" created="Wed, 31 Oct 2012 04:44:06 -0500"  >&lt;p&gt;Thanks for the patch, but it overhinted in some areas (I try to keep hints at an absolute minimum to maximize readability) and overconstrained in others (e.g. ThreadPoolExecutor vs. Executor).&lt;/p&gt;

&lt;p&gt;Fixed @ &lt;a href=&quot;https://github.com/clojure/tools.nrepl/commit/ac95dc7da973f3d7edea75d0f6f9ce01ee18641d&quot;&gt;https://github.com/clojure/tools.nrepl/commit/ac95dc7da973f3d7edea75d0f6f9ce01ee18641d&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11635" name="nrepl-35-eliminate-reflection-v1.txt" size="7533" author="jafingerhut" created="Sun, 28 Oct 2012 22:12:37 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-31] REPL utilities are refered into *ns* prior to every expression evaluation</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-31</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;The refers of REPL utilities (&lt;tt&gt;pst&lt;/tt&gt;, &lt;tt&gt;pprint&lt;/tt&gt;, etc) happens in &lt;tt&gt;clojure.main/repl&lt;/tt&gt;.  In a terminal/single-threaded REPL, this is called just once, so it only ever affects the &lt;tt&gt;user&lt;/tt&gt; namespace.  Every expression sent for evaluation by nREPL invokes &lt;tt&gt;clojure.main/repl&lt;/tt&gt; though, so moving &lt;tt&gt;&amp;#42;ns&amp;#42;&lt;/tt&gt; around will inadvertently cause those refers to happen over and over, into non-&lt;tt&gt;user&lt;/tt&gt; namespaces.  (I&apos;ve been enjoying having &lt;tt&gt;pprint&lt;/tt&gt; and &lt;tt&gt;pp&lt;/tt&gt; available all the time, but I&apos;d never thought much about why they were always there.)&lt;/p&gt;

&lt;p&gt;In the end, this is an nREPL bug.&lt;/p&gt;

&lt;p&gt;I don&apos;t see any easy way out off the top of my head.  I think nREPL will end up having to stop using &lt;tt&gt;clojure.main/repl&lt;/tt&gt;, and maintain a modified version of it itself (something I wanted to avoid exactly so as to benefit from the changes to &lt;tt&gt;clojure.main/repl&lt;/tt&gt; from version to version of Clojure).&lt;/p&gt;

&lt;p&gt;Suggestions most welcome.&lt;/p&gt;

&lt;p&gt;(Originally reported &lt;a href=&quot;http://code.google.com/p/counterclockwise/issues/detail?id=443&quot;&gt;here&lt;/a&gt;.)&lt;/p&gt;</description>
                <environment></environment>
            <key id="15731">NREPL-31</key>
            <summary>REPL utilities are refered into *ns* prior to every expression evaluation</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="2" iconUrl="http://dev.clojure.org/jira/images/icons/priority_critical.gif">Critical</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="2">Declined</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Mon, 1 Oct 2012 15:51:26 -0500</created>
                <updated>Mon, 22 Oct 2012 20:01:40 -0500</updated>
                    <resolved>Mon, 22 Oct 2012 20:01:40 -0500</resolved>
                            <version>0.2.0-beta9</version>
                                <fixVersion>0.2.0</fixVersion>
                <fixVersion>0.2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="29635" author="cemerick" created="Thu, 11 Oct 2012 14:10:12 -0500"  >&lt;p&gt;Hopefully &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1085&quot; title=&quot;clojure.main/repl unconditionally refers REPL utilities into *ns*&quot;&gt;&lt;del&gt;CLJ-1085&lt;/del&gt;&lt;/a&gt; is resolved and this can drop off.  In the meantime, not going to hold off -beta10 for it or this.&lt;/p&gt;</comment>
                    <comment id="29770" author="cemerick" created="Mon, 22 Oct 2012 20:01:40 -0500"  >&lt;p&gt;Fixed upstream in &lt;a href=&quot;http://dev.clojure.org/jira/browse/CLJ-1085&quot; title=&quot;clojure.main/repl unconditionally refers REPL utilities into *ns*&quot;&gt;&lt;del&gt;CLJ-1085&lt;/del&gt;&lt;/a&gt;.  Note that this issue will continue to affect those using Clojure &amp;lt; 1.5.0.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-17] Agent nesting causes issues</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-17</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;We talked about this briefly on IRC/github: &lt;a href=&quot;https://github.com/overtone/overtone/issues/85&quot;&gt;https://github.com/overtone/overtone/issues/85&lt;/a&gt;. I guess the nicest way to fix it would be to stop using agents in nREPL. There&apos;s only one spot where agents are created, and a few send-off calls (no sends), all internal, so any solution will be non-intrusive from an API perspective.&lt;/p&gt;

&lt;p&gt;One implementation idea is to use a simple blocking queue and thread pool in java-land.&lt;/p&gt;

&lt;p&gt;Another is to use nearly the same implementation as Agent, but remove the nesting restriction (call it NestableAgent?). Also get rid of the STM interaction and validator business since those aren&apos;t available outside the clojure.lang package &lt;img class=&quot;emoticon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/emoticons/sad.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;  - and then provide a parallel version of send-off. I&apos;ve spiked a bit on this one, but I&apos;m starting to think a plain queue/thread pool is cleaner.&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;/p&gt;</description>
                <environment></environment>
            <key id="15331">NREPL-17</key>
            <summary>Agent nesting causes issues</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="1" iconUrl="http://dev.clojure.org/jira/images/icons/priority_blocker.gif">Blocker</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="trptcolin">Colin Jones</reporter>
                        <labels>
                    </labels>
                <created>Fri, 13 Apr 2012 00:11:34 -0500</created>
                <updated>Mon, 16 Apr 2012 15:08:50 -0500</updated>
                    <resolved>Mon, 16 Apr 2012 15:08:50 -0500</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="28123" author="cemerick" created="Fri, 13 Apr 2012 05:18:18 -0500"  >&lt;p&gt;Yes, I started working on this yesterday.  Agents have definitely proven themselves unsuitable here, and a poor choice.&lt;/p&gt;

&lt;p&gt;I&apos;m not going to be fancy; we don&apos;t need fancy here.&lt;/p&gt;</comment>
                    <comment id="28124" author="trptcolin" created="Fri, 13 Apr 2012 05:49:01 -0500"  >&lt;p&gt;Great news! Thanks for the quick response.&lt;/p&gt;</comment>
                    <comment id="28164" author="cemerick" created="Mon, 16 Apr 2012 15:08:50 -0500"  >&lt;p&gt;Fixed in &lt;tt&gt;0.2.0-beta6&lt;/tt&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-14] Exception when running -main from clojure.tools.nrepl.cmdline</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-14</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;Running -main from clojure.tools.nrepl.cmdline gives the following exception:&lt;/p&gt;

&lt;p&gt;Exception in thread &quot;main&quot; java.lang.IllegalArgumentException: No value supplied for key: 0&lt;br/&gt;
	at clojure.lang.PersistentHashMap.createWithCheck(PersistentHashMap.java:89)&lt;br/&gt;
	at clojure.core$hash_map.doInvoke(core.clj:355)&lt;br/&gt;
	at clojure.lang.RestFn.applyTo(RestFn.java:137)&lt;br/&gt;
	at clojure.core$apply.invoke(core.clj:600)&lt;br/&gt;
	at clojure.tools.nrepl.server$start_server.doInvoke(server.clj:65)&lt;br/&gt;
	at clojure.lang.RestFn.invoke(RestFn.java:408)&lt;br/&gt;
	at clojure.tools.nrepl.cmdline$_main.doInvoke(cmdline.clj:74)&lt;br/&gt;
	at clojure.lang.RestFn.invoke(RestFn.java:397)&lt;br/&gt;
	at clojure.lang.Var.invoke(Var.java:397)&lt;br/&gt;
	at clojure.lang.AFn.applyToHelper(AFn.java:159)&lt;br/&gt;
	at clojure.lang.Var.applyTo(Var.java:518)&lt;br/&gt;
	at clojure.core$apply.invoke(core.clj:600)&lt;br/&gt;
	at clojure.main$main_opt.invoke(main.clj:323)&lt;br/&gt;
	at clojure.main$main.doInvoke(main.clj:426)&lt;br/&gt;
	at clojure.lang.RestFn.invoke(RestFn.java:421)&lt;br/&gt;
	at clojure.lang.Var.invoke(Var.java:405)&lt;br/&gt;
	at clojure.lang.AFn.applyToHelper(AFn.java:163)&lt;br/&gt;
	at clojure.lang.Var.applyTo(Var.java:518)&lt;br/&gt;
	at clojure.main.main(main.java:37)&lt;/p&gt;

&lt;p&gt;It looks like the repl/connect and start-server functions have changed since cmdline.clj was written. I attached a patch that updates their usage.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15264">NREPL-14</key>
            <summary>Exception when running -main from clojure.tools.nrepl.cmdline</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="misfo">Trent Ogren</reporter>
                        <labels>
                    </labels>
                <created>Tue, 6 Mar 2012 03:31:01 -0600</created>
                <updated>Wed, 20 Jun 2012 07:36:59 -0500</updated>
                    <resolved>Wed, 20 Jun 2012 07:36:59 -0500</resolved>
                            <version>0.2.0</version>
                                <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="28883" author="cemerick" created="Wed, 20 Jun 2012 07:36:59 -0500"  >&lt;p&gt;Merged, thanks!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10979" name="0001-Fix-calls-using-old-function-signatures.patch" size="1405" author="misfo" created="Tue, 6 Mar 2012 03:31:01 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <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>

<item>
            <title>[NREPL-13] nrepl should support binding to a specific interface instead of all</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-13</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;nrepl currently accepts a :port to bind to as an option, and uses that with the single-arg ServerSocket constructor, which binds to that port on all interfaces. I propose we add a :host option as well that can be used to specify the hostname or address of the interface to bind to.&lt;/p&gt;

&lt;p&gt;Here is a potential implementation:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;diff --git a/src/main/clojure/clojure/tools/nrepl/server.clj b/src/main/clojure/clojure/tools/nrepl/server.clj
index 9dbac40..b6f625b 100644
--- a/src/main/clojure/clojure/tools/nrepl/server.clj
+++ b/src/main/clojure/clojure/tools/nrepl/server.clj
@@ -8,7 +8,7 @@
                                             pr-values
                                             session))
   (:use [clojure.tools.nrepl.misc :only (returning response-for log)])
-  (:import (java.net Socket ServerSocket)))
+  (:import (java.net InetAddress Socket ServerSocket)))
 
 (defn unknown-op
   &quot;Sends an :unknown-op :error for the given message.&quot;
@@ -64,7 +64,9 @@
 
 (defn start-server
   &quot;Starts a socket-based nREPL server.  Configuration options include:
- 
+
+   * :host &#8212; the address or hostname of the interface that should be used;
+       defaults to all interfaces
    * :port &#8212; defaults to 0, which autoselects an open port on localhost
    * :handler &#8212; the nREPL message handler to use for each incoming connection;
        defaults to the result of (default-handler)
@@ -77,8 +79,10 @@
 
    Returns a handle to the server that is started, which may be stopped
    either via `stop-server`, (.close server), or automatically via `with-open`.&quot;
-  [&amp;amp; {:keys [port transport-fn handler ack-port greeting-fn] :or {port 0}}]
-  (let [ss (ServerSocket. port)
+  [&amp;amp; {:keys [host port transport-fn handler ack-port greeting-fn] :or {port 0}}]
+  (let [ss  (if host
+              (ServerSocket. port 0 (InetAddress/getByName host))
+              (ServerSocket. port))
         smap {:ss ss
               :transport (or transport-fn t/bencode)
               :greeting greeting-fn
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m putting a CA in the mail today.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15253">NREPL-13</key>
            <summary>nrepl should support binding to a specific interface instead of all</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="tcrawley">Toby Crawley</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Feb 2012 14:32:44 -0600</created>
                <updated>Thu, 29 Mar 2012 12:53:44 -0500</updated>
                    <resolved>Thu, 29 Mar 2012 12:53:44 -0500</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="28051" author="cemerick" created="Thu, 29 Mar 2012 12:53:44 -0500"  >&lt;p&gt;Fixed on master, released as part of &lt;tt&gt;0.2.0-beta3&lt;/tt&gt;.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <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>

<item>
            <title>[NREPL-12] Intermittent test failures for stdin</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-12</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;Failures like these are happening sometimes in the test suite, mainly around stdin:&lt;/p&gt;

&lt;p&gt;FAIL in (request-multiple-read-objects-&lt;b&gt;in&lt;/b&gt;) (nrepl_test.clj:211)&lt;br/&gt;
expected: (= (quote (:ohai)) (response-values (for &lt;span class=&quot;error&quot;&gt;&amp;#91;resp (repl-eval session &amp;quot;(read)&amp;quot;)&amp;#93;&lt;/span&gt; (do (when (-&amp;gt; resp :status set (contains? &quot;need-input&quot;)) (session {:op :stdin, :stdin &quot;:ohai :kthxbai\n&quot;})) resp))))&lt;br/&gt;
  actual: (not (= (:ohai) nil))&lt;/p&gt;

&lt;p&gt;FAIL in (request-multiple-read-objects-&lt;b&gt;in&lt;/b&gt;) (nrepl_test.clj:217)&lt;br/&gt;
expected: (= &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot; :kthxbai&amp;quot;&amp;#93;&lt;/span&gt; (repl-values session &quot;(read-line)&quot;))&lt;br/&gt;
  actual: (not (= &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot; :kthxbai&amp;quot;&amp;#93;&lt;/span&gt; nil))&lt;/p&gt;

&lt;p&gt;I&apos;ve done a ton of debugging and thinking about this, and haven&apos;t gotten far. A few theories I had that seemed decent at the time, but ultimately haven&apos;t gotten rid of these occasional failures:&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;in middleware.session/add-stdin, flush the :stdin-writer after writing to it on :stdin messages (see &lt;a href=&quot;http://stackoverflow.com/questions/2843555/better-alternative-for-pipedreader-pipedwriter&quot;&gt;http://stackoverflow.com/questions/2843555/better-alternative-for-pipedreader-pipedwriter&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;in server/handler, when a message is received on the transport, farm the handling out to a future (this is half-baked &amp;amp; caused additional intermittent failures)&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;The debugging I&apos;ve been doing (print statements galore) suggests that when this problem happens, the client does send back the proper :stdin, but it doesn&apos;t get picked up by the add-stdin handler in time to write to the :stdin-writer and avoid the expiring timeout.&lt;/p&gt;

&lt;p&gt;I&apos;m pretty much stumped at this point, unfortunately.&lt;/p&gt;</description>
                <environment></environment>
            <key id="15248">NREPL-12</key>
            <summary>Intermittent test failures for stdin</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="2" iconUrl="http://dev.clojure.org/jira/images/icons/priority_critical.gif">Critical</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="trptcolin">Colin Jones</reporter>
                        <labels>
                    </labels>
                <created>Sun, 26 Feb 2012 13:04:29 -0600</created>
                <updated>Sun, 10 Jun 2012 16:40:48 -0500</updated>
                    <resolved>Sun, 10 Jun 2012 16:40:48 -0500</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="28052" author="cemerick" created="Thu, 29 Mar 2012 16:18:56 -0500"  >&lt;p&gt;This is becoming a serious problem; the build fails half the time on build.clojure.org, making it incredibly frustrating to perform releases, etc.&lt;/p&gt;

&lt;p&gt;Any new ideas / evaluation of this is most welcome.&lt;/p&gt;</comment>
                    <comment id="28153" author="trptcolin" created="Sun, 15 Apr 2012 22:24:08 -0500"  >&lt;p&gt;My current vague suspicion is that it&apos;s a CPU contention thing between the server and client.  &lt;/p&gt;

&lt;p&gt;It&apos;s kind of hard for me to reason about the execution of the response-values lazy seq, and where the blocking actually happens. And of course adding logging changes the behavior sometimes. I wouldn&apos;t be opposed to adding sleeps in there, but I expect those kinds of things would still be flaky later, on build machines in particular :/&lt;/p&gt;

&lt;p&gt;Incidentally, bumping the client timeout up to Long.MAX_VALUE helps a bit the stdin failures, but doesn&apos;t solve them. It does create new ones: session-lifecycle, unknown-op, and read-timeout block forever trying to reduce across the whole seq in combine-responses. It was a bit surprising to me to see that reduce in the response-values pipeline, and I pursued that at one point as well, but it hasn&apos;t gotten me anywhere. Decreasing the timeout helps to reproduce the failures.&lt;/p&gt;

&lt;p&gt;I got this thread dump from a blocking-forever stdin test (run via `lein test clojure.tools.nrepl-test`): &lt;a href=&quot;https://refheap.com/paste/2141&quot;&gt;https://refheap.com/paste/2141&lt;/a&gt;. &lt;/p&gt;</comment>
                    <comment id="28688" author="trptcolin" created="Sun, 3 Jun 2012 05:07:49 -0500"  >&lt;p&gt;With this patch, I was able to run clojure.tools.nrepl-test 100 times successfully. Previous attempts would generally only get as far as 15 or so before failing for one reason or another.&lt;/p&gt;

&lt;p&gt;It also gets rid of a race condition with my skip-if-eol stuff that was addressing multiple input reads. Lastly, it avoids the need for the 10-second timeout, so the tests are faster now as well.&lt;/p&gt;</comment>
                    <comment id="28766" author="cemerick" created="Sat, 9 Jun 2012 10:57:22 -0500"  >&lt;p&gt;I&apos;m psyched that you may have found the solution to these problems.  I&apos;ve applied the patch locally, and it tests well.  I want to eyeball it for a minute (probably tomorrow) before moving on.&lt;/p&gt;</comment>
                    <comment id="28769" author="cemerick" created="Sun, 10 Jun 2012 16:40:48 -0500"  >&lt;p&gt;Pushed, will be in the next beta release.  Thanks so much!&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11286" name="0001-Improve-timing-issues-in-tests.patch" size="3850" author="trptcolin" created="Sun, 3 Jun 2012 05:07:49 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-10] SocketExceptions on transport/bencode when the other end has gone away</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-10</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;When running the tests, I&apos;m occasionally getting SocketExceptions (which don&apos;t fail the test suite) with the message &quot;Broken pipe&quot;. I think these stem from one end of the nREPL socket trying to write to the socket after the other end has gone away. &lt;/p&gt;

&lt;p&gt;There&apos;s an existing test (ensure-closeable) that explicitly expects a SocketException to be raised if the socket has had .close called directly on it, rather than having the other end hang up, which I think is what the &quot;Broken pipe&quot; tells us. I&apos;m curious as to whether this is important for some reason I haven&apos;t seen, or whether catching all SocketExceptions on transport/bencode&apos;s write function and returning nil would be appropriate. &lt;/p&gt;

&lt;p&gt;If the end doing the socket closing actually should affect the behavior, we could sniff the exception message, but that feels a bit yucky.&lt;/p&gt;

&lt;p&gt;I can actually reproduce this in &quot;real life&quot; by firing up an nREPL server / client (`reply --nrepl --port 9999`), then attaching to it (`reply --nrepl --attach 9999`), and in the attached client, run (Thread/sleep 10000) and immediately kill the process. Then the &quot;Broken pipe&quot; exception shows up in the original REPL with the server in the same process.&lt;/p&gt;

&lt;p&gt;I&apos;ve got a patch for this in my bitbucket fork (socket-exception branch): &lt;a href=&quot;https://bitbucket.org/trptcolin/nrepl/changeset/4a432f3ce95a&quot;&gt;https://bitbucket.org/trptcolin/nrepl/changeset/4a432f3ce95a&lt;/a&gt;&lt;/p&gt;</description>
                <environment></environment>
            <key id="15232">NREPL-10</key>
            <summary>SocketExceptions on transport/bencode when the other end has gone away</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="trptcolin">Colin Jones</reporter>
                        <labels>
                    </labels>
                <created>Sun, 19 Feb 2012 15:34:36 -0600</created>
                <updated>Fri, 12 Oct 2012 00:51:13 -0500</updated>
                    <resolved>Fri, 12 Oct 2012 00:51:13 -0500</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                <fixVersion>0.2.0-RC1</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="27790" author="cemerick" created="Tue, 21 Feb 2012 05:35:05 -0600"  >&lt;p&gt;What do we really want to happen when a &lt;tt&gt;SocketException&lt;/tt&gt; (or really, any error) occurs?&lt;/p&gt;

&lt;p&gt;I&apos;m all for better error handling/reporting, but it shouldn&apos;t obfuscate what&apos;s going wrong.  Catching and squelching isn&apos;t doing anyone any favors.  That could be particularly confusing if done at the transport level. &quot;You mean all the messages I&apos;ve been sending have been dropped on the floor silently, and I was supposed to be checking for a &lt;tt&gt;nil&lt;/tt&gt; return?&quot;&lt;/p&gt;</comment>
                    <comment id="27877" author="trptcolin" created="Sun, 26 Feb 2012 12:46:53 -0600"  >&lt;p&gt;Yeah, you&apos;re right. Although, isn&apos;t checking for a nil return already necessary to account for timeouts?&lt;/p&gt;

&lt;p&gt;What about having a server-side transport error handler that&apos;s rebindable, and re-throws by default? Or maybe we could collect errors somewhere, similar to what clojure.core/agent-error does.&lt;/p&gt;

&lt;p&gt;The more I think about it, the less important this seems, though - mainly an annoyance when running tests.&lt;/p&gt;</comment>
                    <comment id="29639" author="cemerick" created="Fri, 12 Oct 2012 00:51:13 -0500"  >&lt;p&gt;Was simply a disconnection stacktrace due to a client closing up prior to an evaluation response being written to the transport.&lt;/p&gt;

&lt;p&gt;Fixed in &lt;a href=&quot;https://github.com/clojure/tools.nrepl/commit/2d90bdd4fe14298bbfcaab52ecdea48781c71604&quot;&gt;https://github.com/clojure/tools.nrepl/commit/2d90bdd4fe14298bbfcaab52ecdea48781c71604&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-6] Add simple HOWTO to README for both tooling and application developers</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-6</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;...maybe push the protocol details into a /doc directory.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14660">NREPL-6</key>
            <summary>Add simple HOWTO to README for both tooling and application developers</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Sep 2011 11:15:53 -0500</created>
                <updated>Wed, 21 Nov 2012 15:50:42 -0600</updated>
                    <resolved>Wed, 21 Nov 2012 15:50:42 -0600</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-5] Add support for reading from stdin</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-5</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;Swank does this by polling back to the connected client to request input.  In the face of asynchronous operations, this may be the only option.&lt;/p&gt;

&lt;p&gt;Will require adding to the protocol.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14659">NREPL-5</key>
            <summary>Add support for reading from stdin</summary>
                <type id="4" iconUrl="http://dev.clojure.org/jira/images/icons/improvement.gif">Enhancement</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Sep 2011 11:14:24 -0500</created>
                <updated>Tue, 21 Feb 2012 05:58:42 -0600</updated>
                    <resolved>Tue, 21 Feb 2012 05:58:42 -0600</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="27792" author="cemerick" created="Tue, 21 Feb 2012 05:58:42 -0600"  >&lt;p&gt;See &lt;tt&gt;clojure.tools.nrepl.middleware.session/add-stdin&lt;/tt&gt; for the implementation.  Userland documentation coming.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-2] send-ack probably leaks connections/sockets</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-2</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;The &lt;tt&gt;let&lt;/tt&gt; in &lt;tt&gt;send-ack&lt;/tt&gt; should be be &lt;tt&gt;with-open&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14656">NREPL-2</key>
            <summary>send-ack probably leaks connections/sockets</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="2" iconUrl="http://dev.clojure.org/jira/images/icons/priority_critical.gif">Critical</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Sep 2011 10:35:10 -0500</created>
                <updated>Tue, 21 Feb 2012 05:55:56 -0600</updated>
                    <resolved>Tue, 21 Feb 2012 05:55:56 -0600</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                                <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>

<item>
            <title>[NREPL-1] Whitespace is not printed via :out</title>
                <link>http://dev.clojure.org/jira/browse/NREPL-1</link>
                <project id="10022" key="NREPL">tools.nrepl</project>
                        <description>&lt;p&gt;This:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;=&amp;gt; (println &lt;span class=&quot;code-quote&quot;&gt;&quot; &quot;&lt;/span&gt;)
nil&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Should be this:&lt;/p&gt;

&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;=&amp;gt; (println &lt;span class=&quot;code-quote&quot;&gt;&quot; &quot;&lt;/span&gt;)
 
nil&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Perhaps &lt;tt&gt;:out&lt;/tt&gt; isn&apos;t being sent if the content {{.trim}}s down to a zero-length string?&lt;/p&gt;</description>
                <environment></environment>
            <key id="14655">NREPL-1</key>
            <summary>Whitespace is not printed via :out</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="cemerick">Chas Emerick</assignee>
                                <reporter username="cemerick">Chas Emerick</reporter>
                        <labels>
                    </labels>
                <created>Fri, 30 Sep 2011 10:33:03 -0500</created>
                <updated>Tue, 21 Feb 2012 05:54:01 -0600</updated>
                    <resolved>Tue, 21 Feb 2012 05:54:01 -0600</resolved>
                                            <fixVersion>0.2.0</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="27791" author="cemerick" created="Tue, 21 Feb 2012 05:54:01 -0600"  >&lt;p&gt;Resolved in the redesign.&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>