<!-- 
RSS generated by JIRA (5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9) at Sat May 18 12:59:00 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://www.couchbase.com/issues/si/jira.issueviews:issue-xml/JCBC-65/JCBC-65.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Couchbase</title>
    <link>http://www.couchbase.com/issues</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>5.2.4</version>
        <build-number>845</build-number>
        <build-date>26-12-2012</build-date>
    </build-info>

<item>
            <title>[JCBC-65] Client constructor blocks or deadlocks</title>
                <link>http://www.couchbase.com/issues/browse/JCBC-65</link>
                <project id="10080" key="JCBC">Couchbase Java Client</project>
                        <description>I am evaluating the couchbase product and hit a brick wall immediately when running through the simple hello world example.&lt;br/&gt;
&lt;br/&gt;
I have a 3 node cluster running couchbase enterprise 1.8.2 on ubuntu 10.04 64 bit VMware images. All three are running in VMWare player instances on Windows 7 64bit.&lt;br/&gt;
&lt;br/&gt;
When I try to run the Main example on Windows 7 using Java6 (64 bit) the code blocks somewhere in the Client constructor. The result is the logging below.&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
2012-06-14 14:07:46.313 INFO com.couchbase.client.CouchbaseConnection:  Added {QA sa=/192.168.186.150:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue&lt;br/&gt;
2012-06-14 14:07:46.316 INFO com.couchbase.client.CouchbaseConnection:  Added {QA sa=/192.168.186.151:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue&lt;br/&gt;
2012-06-14 14:07:46.319 INFO com.couchbase.client.CouchbaseConnection:  Added {QA sa=/192.168.186.152:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue&lt;br/&gt;
2012-06-14 14:07:59.843 INFO com.couchbase.client.CouchbaseConnection:  Connection state changed for &lt;a href=&apos;mailto:sun.nio.ch.SelectionKeyImpl@24a4e2e3&apos;&gt;sun.nio.ch.SelectionKeyImpl@24a4e2e3&lt;/a&gt;&lt;br/&gt;
2012-06-14 14:08:52.983 INFO com.couchbase.client.CouchbaseConnection:  Connection state changed for &lt;a href=&apos;mailto:sun.nio.ch.SelectionKeyImpl@21ec6696&apos;&gt;sun.nio.ch.SelectionKeyImpl@21ec6696&lt;/a&gt;&lt;br/&gt;
2012-06-14 14:08:52.987 INFO com.couchbase.client.CouchbaseConnection:  Connection state changed for &lt;a href=&apos;mailto:sun.nio.ch.SelectionKeyImpl@27431340&apos;&gt;sun.nio.ch.SelectionKeyImpl@27431340&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
I have also tried debugging but the code blocks in the constructor at&lt;br/&gt;
&lt;br/&gt;
client = new CouchbaseClient(uris, &amp;quot;default&amp;quot;, &amp;quot;&amp;quot;);&lt;br/&gt;
&lt;br/&gt;
The program never completes.&lt;br/&gt;
&lt;br/&gt;
This works fine in a Linux environment with the following output received&lt;br/&gt;
&lt;br/&gt;
2012-06-14 04:58:50.693 INFO com.couchbase.client.CouchbaseConnection:  Added {QA sa=/192.168.186.150:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue&lt;br/&gt;
2012-06-14 04:58:50.703 INFO com.couchbase.client.CouchbaseConnection:  Added {QA sa=/192.168.186.151:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue&lt;br/&gt;
2012-06-14 04:58:50.708 INFO com.couchbase.client.CouchbaseConnection:  Added {QA sa=/192.168.186.152:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue&lt;br/&gt;
2012-06-14 04:58:50.830 INFO com.couchbase.client.CouchbaseConnection:  Connection state changed for &lt;a href=&apos;mailto:sun.nio.ch.SelectionKeyImpl@1bc74f37&apos;&gt;sun.nio.ch.SelectionKeyImpl@1bc74f37&lt;/a&gt;&lt;br/&gt;
2012-06-14 04:58:50.834 INFO com.couchbase.client.CouchbaseConnection:  Connection state changed for &lt;a href=&apos;mailto:sun.nio.ch.SelectionKeyImpl@3a21b220&apos;&gt;sun.nio.ch.SelectionKeyImpl@3a21b220&lt;/a&gt;&lt;br/&gt;
2012-06-14 04:58:50.843 INFO com.couchbase.client.CouchbaseConnection:  Connection state changed for &lt;a href=&apos;mailto:sun.nio.ch.SelectionKeyImpl@732b3d53&apos;&gt;sun.nio.ch.SelectionKeyImpl@732b3d53&lt;/a&gt;&lt;br/&gt;
2012-06-14 04:58:51.135 INFO com.couchbase.client.CouchbaseConnection:  Shut down Couchbase client&lt;br/&gt;
Set Succeeded&lt;br/&gt;
Synchronous Get failed&lt;br/&gt;
Asynchronous Get Succeeded: Hello World!&lt;br/&gt;
&lt;br/&gt;
Is there a JDK for windows 7 or a configuration setting that can be used to prevent this?</description>
                <environment>OS: Windows 7 64bit&lt;br/&gt;
JDK: 1.6.0_31 also 1.6.0_33 64 bit&lt;br/&gt;
Couchbase enterprise edition running on 3 nodes all Ubuntu 10.04 64bit server (VMware images)&lt;br/&gt;
</environment>
            <key id="17800">JCBC-65</key>
            <summary>Client constructor blocks or deadlocks</summary>
                <type id="1" iconUrl="http://www.couchbase.com/issues/images/icons/issuetypes/bug.png">Bug</type>
                                <priority id="3" iconUrl="http://www.couchbase.com/issues/images/icons/priorities/major.png">Major</priority>
                    <status id="4" iconUrl="http://www.couchbase.com/issues/images/icons/statuses/reopened.png">Reopened</status>
                    <resolution id="-1">Unresolved</resolution>
                    <security id="10011">Public</security>
                        <assignee username="daschl">Michael Nitschinger</assignee>
                                <reporter username="mscott">Martin Scott</reporter>
                        <labels>
                    </labels>
                <created>Thu, 14 Jun 2012 08:13:11 -0500</created>
                <updated>Wed, 17 Apr 2013 12:28:58 -0500</updated>
                                    <version>1.0.2</version>
                                <fixVersion>1.1-beta</fixVersion>
                                <component>library</component>
                                <votes>0</votes>
                        <watches>2</watches>
                                                    <comments>
                    <comment id="29962" author="rags" created="Thu, 14 Jun 2012 09:07:48 -0500"  >Thanks for giving the Java client library a spin.&lt;br/&gt;
&lt;br/&gt;
Were you able to connect to a single windows 7 node? I suspect it might be a firewall/networking issue and if you can use the netstat command (or the appropriate command on windows 7)?&lt;br/&gt;
&lt;br/&gt;
You may also want to follow the instructions noted in&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-bestpractice-cloud.html&quot;&gt;http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-bestpractice-cloud.html&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
Changing IP addresses might be a cause for this.&lt;br/&gt;
&lt;br/&gt;
Finally, a more detailed log would be useful, if the network troubleshooting does not help.&lt;br/&gt;
&lt;br/&gt;
Please refer to&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;http://www.couchbase.com/wiki/display/couchbase/Couchbase+Java+Client+Library&quot;&gt;http://www.couchbase.com/wiki/display/couchbase/Couchbase+Java+Client+Library&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
for logging tips.&lt;br/&gt;
</comment>
                    <comment id="29963" author="mscott" created="Thu, 14 Jun 2012 09:31:21 -0500"  >Apologies that should read&lt;br/&gt;
&lt;br/&gt;
Couchbase Version: 1.8.0 enterprise edition (build-55)</comment>
                    <comment id="29965" author="mscott" created="Thu, 14 Jun 2012 10:06:57 -0500"  >Detailed logging up to the point when the client hangs</comment>
                    <comment id="29966" author="rags" created="Thu, 14 Jun 2012 10:12:07 -0500"  >Thanks for the Log. I took a real quick look.&lt;br/&gt;
&lt;br/&gt;
Were you able to follow the steps in&lt;br/&gt;
&lt;br/&gt;
&lt;a href=&quot;http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-bestpractice-cloud.html&quot;&gt;http://www.couchbase.com/docs/couchbase-manual-1.8/couchbase-bestpractice-cloud.html&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
and use the ip address that you are able to connect to (via the admin console)?</comment>
                    <comment id="29973" author="alex" created="Thu, 14 Jun 2012 11:43:32 -0500"  >Hi Martin,&lt;br/&gt;
&lt;br/&gt;
Can you verify connectivity from the JDK on your windows box?&lt;br/&gt;
&lt;br/&gt;
This is what my connection code looks like:&lt;br/&gt;
		// Connection details for Couchbase&lt;br/&gt;
		List&amp;lt;URI&amp;gt; uris = new LinkedList&amp;lt;URI&amp;gt;();&lt;br/&gt;
		uris.add(URI.create(&amp;quot;&lt;a href=&quot;http://10.4.2.3:8091/pools&quot;&gt;http://10.4.2.3:8091/pools&lt;/a&gt;&amp;quot;));&lt;br/&gt;
&lt;br/&gt;
	    CouchbaseClient client = null;&lt;br/&gt;
	    try {&lt;br/&gt;
	    	client = new CouchbaseClient(uris, &amp;quot;default&amp;quot;, &amp;quot;&amp;quot;);&lt;br/&gt;
	    }   &lt;br/&gt;
	    catch (Exception e) {&lt;br/&gt;
	      System.err.println(&amp;quot;except: connect: &amp;quot; + e.getMessage());&lt;br/&gt;
	      System.exit(-1);&lt;br/&gt;
	    }   &lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
This will create a persistent connection to 8091 on 10.4.2.3 as well as connections to 11210 on every node in the cluster.&lt;br/&gt;
&lt;br/&gt;
ssh&amp;#39;ing to 10.4.2.3 and running netstat - you should see something like whats below:&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
netstat -nat|grep 10.32.3.50&lt;br/&gt;
tcp        0      0 10.4.2.3:11210              10.32.3.50:65437            ESTABLISHED &lt;br/&gt;
tcp        0      0 10.4.2.3:8091               10.32.3.50:65442            ESTABLISHED &lt;br/&gt;
tcp        0    304 ::ffff:10.4.2.3:22          ::ffff:10.32.3.50:65516     ESTABLISHED &lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
can you confirm this in your environment?&lt;br/&gt;
&lt;br/&gt;
thanks&lt;br/&gt;
&lt;br/&gt;
-Alex.</comment>
                    <comment id="30370" author="mscott" created="Mon, 18 Jun 2012 09:36:55 -0500"  >Hi, thanks for the responses.&lt;br/&gt;
&lt;br/&gt;
Here is the netstat output from my Windows client &lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:139      0.0.0.0:0              LISTENING       InHost&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:51008    192.168.186.150:22     ESTABLISHED     InHost&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:53281    192.168.186.150:8091   TIME_WAIT       InHost&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:53284    192.168.186.150:11210  ESTABLISHED     InHost&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:53285    192.168.186.151:11210  ESTABLISHED     InHost&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:53286    192.168.186.152:11210  ESTABLISHED     InHost&lt;br/&gt;
&amp;nbsp;&amp;nbsp;TCP    192.168.186.1:53292    192.168.186.150:8091   ESTABLISHED     InHost&lt;br/&gt;
&lt;br/&gt;
and from the first node in the cluster with the client and other nodes.&lt;br/&gt;
&lt;br/&gt;
tcp        0      0 192.168.186.150:41317   192.168.186.150:11210   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:35883   192.168.186.151:11210   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:11210   192.168.186.151:38013   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:21100   192.168.186.152:46834   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:11210   192.168.186.1:53284     ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:57559   192.168.186.151:22      TIME_WAIT&lt;br/&gt;
tcp        0      0 192.168.186.150:8091    192.168.186.1:53292     ESTABLISHED&lt;br/&gt;
tcp        0     48 192.168.186.150:22      192.168.186.1:51008     ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:11210   192.168.186.150:41317   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:42433   192.168.186.152:11210   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:11210   192.168.186.150:56214   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:56214   192.168.186.150:11210   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:11210   192.168.186.152:39222   ESTABLISHED&lt;br/&gt;
tcp        0      0 192.168.186.150:21100   192.168.186.151:60945   ESTABLISHED&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
I downloaded the source jars from the maven repo and debugging shows the client hanging at the getLatch().await() line below. There doesn&amp;#39;t appear to be any thread calling the countDown method on the latch before or after this is called.&lt;br/&gt;
&lt;br/&gt;
&amp;nbsp;&amp;nbsp;private ChannelFuture getReceivedFuture() {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;try {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;getLatch().await();&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} catch (InterruptedException ex) {&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;finerLog(&amp;quot;Getting received future has been interrupted.&amp;quot;);&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return receivedFuture;&lt;br/&gt;
&amp;nbsp;&amp;nbsp;}&lt;br/&gt;
&lt;br/&gt;
&lt;br/&gt;
Martin.</comment>
                    <comment id="30371" author="mscott" created="Mon, 18 Jun 2012 09:48:59 -0500"  >The stack trace where the client blocks&lt;br/&gt;
&lt;br/&gt;
Thread [main] (Stepping)	&lt;br/&gt;
	BucketUpdateResponseHandler.getReceivedFuture() line: 147	&lt;br/&gt;
	BucketUpdateResponseHandler.getLastResponse() line: 127	&lt;br/&gt;
	BucketMonitor.startMonitor() line: 183	&lt;br/&gt;
	ConfigurationProviderHTTP.subscribe(String, Reconfigurable) line: 243	&lt;br/&gt;
	CouchbaseClient.&amp;lt;init&amp;gt;(CouchbaseConnectionFactory, boolean) line: 158	&lt;br/&gt;
	CouchbaseClient.&amp;lt;init&amp;gt;(CouchbaseConnectionFactory) line: 125	&lt;br/&gt;
	CouchbaseClient.&amp;lt;init&amp;gt;(List&amp;lt;URI&amp;gt;, String, String) line: 77	&lt;br/&gt;
	Main.main(String[]) line: 67	&lt;br/&gt;
&lt;br/&gt;
</comment>
                    <comment id="48397" author="seand88" created="Wed, 23 Jan 2013 14:45:26 -0600"  >I am having this exact same problem. Using windows 7 64 bit trying to connect to ubuntu.&lt;br/&gt;
I am using 32 bit os on linux and couchbase server 2.0.&lt;br/&gt;
&lt;br/&gt;
I am also using the lastest java client version 1.1 &lt;br/&gt;
&lt;br/&gt;
Same Issue as described below.  &lt;br/&gt;
The only workaround is to not use windows, if my java client is running on linux then it will work with no issues, it just deadlocks on the windows machine.&lt;br/&gt;
</comment>
                    <comment id="55358" author="tgrall" created="Wed, 17 Apr 2013 12:28:58 -0500"  >I am reopening the issue as we see this error again on some environment:&lt;br/&gt;
- Yuval&lt;br/&gt;
- &lt;a href=&quot;http://www.couchbase.com/issues/browse/JCBC-65&quot;&gt;http://www.couchbase.com/issues/browse/JCBC-65&lt;/a&gt;&lt;br/&gt;
...&lt;br/&gt;
&lt;br/&gt;
Let me know if you prefer me to create a new issue for 1.1.x</comment>
                </comments>
                    <attachments>
                    <attachment id="13642" name="log.txt" size="6445" author="mscott" created="Thu, 14 Jun 2012 10:06:57 -0500" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                                                                                                                                                    <customfield id="customfield_10081" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Rank</customfieldname>
                <customfieldvalues>
                    <customfieldvalue>10624</customfieldvalue>
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>