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

Bad Authentication Causes Connection Leak

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5.3, 2.5.9
    • Fix Version/s: 2.5.10
    • Component/s: library
    • Labels:

      Description

      From @tomap on Gitter, if there is bad authentication information, connections keep getting opened at a rate of 4 per second and not being closed:

      The problem is that in the background, the couchbaseclient will check the health of the connection with this method:
      https://github.com/couchbase/couchbase-net-client/blob/6e97fb87007f12bbd38ab1159e590bcf62f2046e/Src/Couchbase/Core/Server.cs#L328
      But for that, it will use the broken authentication
      And it will throw internal exceptions, which do not seem to be properly handled because after that, it starts opening connections at a rate of 4 new per seconds, without EVER closing them.
      And we end up with 30K connections open to a couchbase server where we should only have < 100

      System.Security.Authentication.AuthenticationException HResult=0x80131501 Message=Authentication failed for bucket 'papi' Source=Couchbase.NetClient StackTrace: at Couchbase.IO.ConnectionPoolBase`1.Authenticate(IConnection connection) > Couchbase.NetClient.dll!Couchbase.IO.ConnectionPoolBase<Couchbase.IO.MultiplexingConnection>.Authenticate(Couchbase.IO.IConnection connection) Unknown Couchbase.NetClient.dll!Couchbase.IO.SharedConnectionPool<Couchbase.IO.MultiplexingConnection>.CreateAndAuthConnection() Unknown Couchbase.NetClient.dll!Couchbase.IO.SharedConnectionPool<Couchbase.IO.MultiplexingConnection>.Acquire() Unknown Couchbase.NetClient.dll!Couchbase.Core.Server.CheckDataNode() Unknown System.Private.CoreLib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 145 C#
      

        Attachments

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

          Activity

          Hide
          pvarley Patrick Varley added a comment - - edited

          Brant Burnett I will link this ticket via another way to the case, we keep public defects clear of customer details

          Show
          pvarley Patrick Varley added a comment - - edited Brant Burnett I will link this ticket via another way to the case, we keep public defects clear of customer details
          Hide
          btburnett3 Brant Burnett added a comment -

          Great, thanks Patrick Varley

          Show
          btburnett3 Brant Burnett added a comment - Great, thanks Patrick Varley

            People

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              btburnett3 Brant Burnett
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes

                  PagerDuty

                  Error rendering 'com.pagerduty.jira-server-plugin:PagerDuty'. Please contact your Jira administrators.