Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-152

Couchbase Client hangs during instantion of the Client if the request to http://xxx.xxx.xxx.xxx:8091/pools/default/bucketsStreaming/default is blocked or never returns

    Details

    • Type: Bug
    • Status: In Progress
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2 Beta
    • Fix Version/s: backlog-1.0
    • Component/s: library
    • Labels:
      None
    • Environment:
      Windows 7
      Windows Server 2008 VM
      AVG 2012.0.2221
      Coucbase C# Client Library 1.2

      Description

      During instantiation of the client, a MessageStreamListener is created. Inside of the listener is a call is made to the config url

      Line 376 of MessageStreamListener

      this.request = this.requestFactory.GetWebRequest(configUrl, configUrl.GetHashCode().ToString());
      this.response = this.request.GetResponse();

      If this call never completes, for example because AVG silently blocks the request and prevents the data from being returned, then the client will wait indefinitely instead of timing out.

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Show
        aaronmell Aaron Mell added a comment - http://www.couchbase.com/forums/thread/net-client-hangs-client-create#comment-1007661
        Hide
        ingenthr Matt Ingenthron added a comment -

        Not a priority, but let's try to come up with a way to test if this does in fact hang forever. If so, we should fix it.

        Show
        ingenthr Matt Ingenthron added a comment - Not a priority, but let's try to come up with a way to test if this does in fact hang forever. If so, we should fix it.
        Hide
        saakshi.manocha Saakshi Manocha added a comment - - edited

        Yes it is easily reproducible. I have installed AVG on Windows7 machine and server is also installed on same machine. If AVG is enabled, client will never get instatiated, if I disable the AVG, it works perfectly.

        In class Couchbase.BucketConfigListener.cs:

        // subscribe to the config url
        this.listener = this.GetPooledListener();

        // this will be signaled by the config changed event handler
        reset.WaitOne();

        It keeps on waiting endlessly at this code statement - reset.WaitOne(). It wont even time out, the thread just keeps waiting forever.
        While its waiting if we disable the AVG, then it will work absolutely fine.

        The code snippet is attached herewith (i added a statement for Get() method, its not really required, but if included, code assumes we have a key '101' stored already).

        another thing to notice is if in App.config, I change the server address from "http://localhost:8091/pools" to "http://10.3.121.134:8091/pools", it would work fine. (10.3.121.134 actually has server installed)

        Show
        saakshi.manocha Saakshi Manocha added a comment - - edited Yes it is easily reproducible. I have installed AVG on Windows7 machine and server is also installed on same machine. If AVG is enabled, client will never get instatiated, if I disable the AVG, it works perfectly. In class Couchbase.BucketConfigListener.cs: // subscribe to the config url this.listener = this.GetPooledListener(); // this will be signaled by the config changed event handler reset.WaitOne(); It keeps on waiting endlessly at this code statement - reset.WaitOne(). It wont even time out, the thread just keeps waiting forever. While its waiting if we disable the AVG, then it will work absolutely fine. The code snippet is attached herewith (i added a statement for Get() method, its not really required, but if included, code assumes we have a key '101' stored already). another thing to notice is if in App.config, I change the server address from "http://localhost:8091/pools" to "http://10.3.121.134:8091/pools", it would work fine. (10.3.121.134 actually has server installed)
        Hide
        saakshi.manocha Saakshi Manocha added a comment -

        @Matt: Please suggest how shall we proceed with this issue.

        Show
        saakshi.manocha Saakshi Manocha added a comment - @Matt: Please suggest how shall we proceed with this issue.
        Hide
        bcui Bin Cui (Inactive) added a comment -

        Try this command to verify if mecached runs correctly:

        <installroot>/bin/cbworkloadgen -n localhost:8091 -i 1000

        Show
        bcui Bin Cui (Inactive) added a comment - Try this command to verify if mecached runs correctly: <installroot>/bin/cbworkloadgen -n localhost:8091 -i 1000
        Hide
        babbupandey Vinay Pandey added a comment -

        I can replicate this problem without AVG. If I keep creating the Client in the loop 10,000 times, then it gets stuck in the constructor, I am attaching my test application, here is the call-stack from WinDBG:

        System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean)
        Couchbase.BucketConfigListener.Start()
        Couchbase.CouchbasePool.Enyim.Caching.Memcached.IServerPool.Start()
        Couchbase.CouchbaseClient..ctor(Couchbase.ICouchbaseServerPool, Couchbase.Configuration.ICouchbaseClientConfiguration)
        SimpleCouchClientTest.Program+<>c_DisplayClass2.<Main>b_1(Int32) [\Documents\Visual Studio 2012\Projects\SimpleCouchClientTest\SimpleCouchClientTest\Program.cs @ 37]

        Show
        babbupandey Vinay Pandey added a comment - I can replicate this problem without AVG. If I keep creating the Client in the loop 10,000 times, then it gets stuck in the constructor, I am attaching my test application, here is the call-stack from WinDBG: System.Threading.WaitHandle.InternalWaitOne(System.Runtime.InteropServices.SafeHandle, Int64, Boolean, Boolean) Couchbase.BucketConfigListener.Start() Couchbase.CouchbasePool.Enyim.Caching.Memcached.IServerPool.Start() Couchbase.CouchbaseClient..ctor(Couchbase.ICouchbaseServerPool, Couchbase.Configuration.ICouchbaseClientConfiguration) SimpleCouchClientTest.Program+<>c_ DisplayClass2.<Main>b _1(Int32) [\Documents\Visual Studio 2012\Projects\SimpleCouchClientTest\SimpleCouchClientTest\Program.cs @ 37]

          People

          • Assignee:
            saakshi.manocha Saakshi Manocha
            Reporter:
            aaronmell Aaron Mell
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:

              Gerrit Reviews

              There are no open Gerrit changes