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

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.8
    • Fix Version/s: 1.3.0
    • Component/s: library
    • Labels:
      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

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

          Activity

          Show
          jmorris Jeff Morris added a comment - http://review.couchbase.org/#/c/30193/

            People

            • Assignee:
              jmorris Jeff Morris
              Reporter:
              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

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