[NCBC-324] ExecuteGet(string key, DateTime newExpiration) returns unexpected result codes Created: 05/Nov/13  Updated: 03/Dec/13  Resolved: 08/Nov/13

Status: Closed
Project: Couchbase .NET client library
Component/s: library
Affects Version/s: 1.2.8
Fix Version/s: 1.3.0

Type: Bug Priority: Major
Reporter: Jeff Morris Assignee: Jeff Morris
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.

 Comments   
Comment by Jeff Morris [ 03/Dec/13 ]
http://review.couchbase.org/#/c/30193/
Generated at Sat Sep 20 18:49:41 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.