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

ExecuteGet(string key, DateTime newExpiration) returns unexpected result codes

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2.8
    • 1.3.0
    • library
    • None

    Description

      https://www.couchbase.com/issues/browse/CBSE-837:

      We have found an error in .NET SDK which is affecting our tests for session migration from DB to Couchbase. One of the ExecuteGet method overloads is not returning correct status code when requested key is not found. It seems to be an older bug, but the overload was not actively used by out code before. We confirmed it on version 1.2.6 (currently in prod) and latest 1.2.9.

      Sample code:
      using (CouchbaseClient client = new CouchbaseClient("dev"))

      { var res1 = client.ExecuteGet("DoesNotExist"); Console.WriteLine(GetResultXml(res1)); Console.WriteLine(); var res2 = client.ExecuteGet("DoesNotExist", DateTime.UtcNow.AddMinutes(10)); Console.WriteLine(GetResultXml(res2)); Console.WriteLine(); }

      Output:
      <GetOperationResult Success="False" StatusCode="1" CAS="0">
      <Message>Failed to process response: Not found</Message>
      <InnerResult>
      <BinaryOperationResult Success="False" StatusCode="null" CAS="0">
      <Message>Failed to process response: Not found</Message>
      </BinaryOperationResult>
      </InnerResult>
      </GetOperationResult>

      <GetOperationResult Success="False" StatusCode="null" CAS="0">
      <Message>Unable to locate node</Message>
      <InnerResult>
      <PooledSocketResult Success="False" StatusCode="1">
      <Message>Failed to process response</Message>
      <InnerResult>
      <BinaryOperationResult Success="False" StatusCode="null" CAS="0">
      <Message>Failed to process response</Message>
      </BinaryOperationResult>
      </InnerResult>
      </PooledSocketResult>
      </InnerResult>
      </GetOperationResult>

      Both ExecuteGet method overloads should be returning the same response with status code 1 (KeyNotFound). Instead, the second overload is swallowing the correct response status code.

      Attachments

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

        Activity

          People

            jmorris Jeff Morris
            jmorris Jeff Morris
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty