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

Bad Authentication Causes Connection Leak

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 2.5.10
    • 2.5.3, 2.5.9
    • library
    • 1

    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

        For Gerrit Dashboard: NCBC-1666
        # Subject Branch Project Status CR V

        Activity

          People

            jmorris Jeff Morris
            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