Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-6840

GAT not populating proper error information

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-beta-2
    • Component/s: couchbase-bucket
    • Security Level: Public
    • Labels:
      None

      Description

      /*

      • To change this template, choose Tools | Templates
      • and open the template in the editor.
        */
        package com.couchbase.sdkd;

      import com.couchbase.client.CouchbaseClient;
      import java.net.URI;
      import java.util.LinkedList;
      import java.util.List;
      import net.spy.memcached.CASValue;
      import net.spy.memcached.internal.OperationFuture;

      /**
      *

      • @author mnunberg
        */
        public class GatBug {
        public static void main(String[] args)
        throws Exception { URI url = new URI("http://localhost:8091/pools"); List<URI> ul = new LinkedList<URI>(); ul.add(url); CouchbaseClient cli = new CouchbaseClient(ul, "default", ""); OperationFuture gop = cli.asyncGetAndTouch("non-existent-key", 5); gop.get(); System.err.println(gop.getStatus()); }

        }

      /** output **/

      2012-09-12 16:28:28.855 INFO com.couchbase.client.CouchbaseConnection: Added

      {QA sa=/10.0.0.99:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      to connect queue
      2012-09-12 16:28:28.857 INFO com.couchbase.client.CouchbaseConnection: Added

      {QA sa=/10.0.0.20:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

      to connect queue
      2012-09-12 16:28:29.166 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@2cb0ce8f
      2012-09-12 16:28:29.167 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@bc92535

      {OperationStatus success=false: }
      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        mikew Mike Wiederhold added a comment - - edited

        This result looks correct to me. When you print the status it says the operation failed. Can you tell me what you expect the the result to be? Please assign back to me after you comment.

        Show
        mikew Mike Wiederhold added a comment - - edited This result looks correct to me. When you print the status it says the operation failed. Can you tell me what you expect the the result to be? Please assign back to me after you comment.
        Hide
        mnunberg Mark Nunberg added a comment - - edited

        the key does not exist on the server so it should be ENOENT, or 'Not Found'.

        Show
        mnunberg Mark Nunberg added a comment - - edited the key does not exist on the server so it should be ENOENT, or 'Not Found'.
        Hide
        mikew Mike Wiederhold added a comment -

        Mark,

        In my example that I ran this is what I got. Please print the result of getStatus().getMessage() and you should get something back that says the key was not found. In any case the operation did properly return that the operation wasn't successful.

        Show
        mikew Mike Wiederhold added a comment - Mark, In my example that I ran this is what I got. Please print the result of getStatus().getMessage() and you should get something back that says the key was not found. In any case the operation did properly return that the operation wasn't successful.
        Hide
        mnunberg Mark Nunberg added a comment -

        public class GatBug {
        public static void main(String[] args)
        throws Exception

        { URI url = new URI("http://localhost:8091/pools"); List<URI> ul = new LinkedList<URI>(); ul.add(url); CouchbaseClient cli = new CouchbaseClient(ul, "default", ""); OperationFuture gop = cli.asyncGetAndTouch("non-existent-key", 5); gop.get(); System.err.printf("Status=%s, Message=%s\n", gop.getStatus(), gop.getStatus().getMessage()); gop = cli.asyncGets("non-existent-key"); gop.get(); System.err.printf("status=%s, Message=%s\n", gop.getStatus(), gop.getStatus().getMessage()); }

        }

        /****
        2012-10-04 21:10:47.508 INFO com.couchbase.client.CouchbaseConnection: Added

        {QA sa=/127.0.0.1:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0}

        to connect queue
        2012-10-04 21:10:47.518 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@bc92535
        Status=

        {OperationStatus success=false: }

        , Message=
        status=

        {OperationStatus success=false: Not found}

        , Message=Not found
        ****/

        Show
        mnunberg Mark Nunberg added a comment - public class GatBug { public static void main(String[] args) throws Exception { URI url = new URI("http://localhost:8091/pools"); List<URI> ul = new LinkedList<URI>(); ul.add(url); CouchbaseClient cli = new CouchbaseClient(ul, "default", ""); OperationFuture gop = cli.asyncGetAndTouch("non-existent-key", 5); gop.get(); System.err.printf("Status=%s, Message=%s\n", gop.getStatus(), gop.getStatus().getMessage()); gop = cli.asyncGets("non-existent-key"); gop.get(); System.err.printf("status=%s, Message=%s\n", gop.getStatus(), gop.getStatus().getMessage()); } } /**** 2012-10-04 21:10:47.508 INFO com.couchbase.client.CouchbaseConnection: Added {QA sa=/127.0.0.1:11210, #Rops=0, #Wops=0, #iq=0, topRop=null, topWop=null, toWrite=0, interested=0} to connect queue 2012-10-04 21:10:47.518 INFO com.couchbase.client.CouchbaseConnection: Connection state changed for sun.nio.ch.SelectionKeyImpl@bc92535 Status= {OperationStatus success=false: } , Message= status= {OperationStatus success=false: Not found} , Message=Not found ****/
        Show
        mikew Mike Wiederhold added a comment - http://review.couchbase.org/#/c/21697/
        Hide
        thuan Thuan Nguyen added a comment -

        Integrated in github-ep-engine-2-0 #444 (See http://qa.hq.northscale.net/job/github-ep-engine-2-0/444/)
        MB-6840: GAT returns error messages when an error occurs (Revision 10b593cf4d97eaf062a6076878c5f8000d093ee9)

        Result = SUCCESS
        Mike Wiederhold :
        Files :

        • src/ep_engine.cc
        Show
        thuan Thuan Nguyen added a comment - Integrated in github-ep-engine-2-0 #444 (See http://qa.hq.northscale.net/job/github-ep-engine-2-0/444/ ) MB-6840 : GAT returns error messages when an error occurs (Revision 10b593cf4d97eaf062a6076878c5f8000d093ee9) Result = SUCCESS Mike Wiederhold : Files : src/ep_engine.cc
        Hide
        kzeller kzeller added a comment -

        was fixed in 2.0 so moved away from .next

        Show
        kzeller kzeller added a comment - was fixed in 2.0 so moved away from .next
        Hide
        kzeller kzeller added a comment -

        Added to release notes as:

        Get-and-touch returned incorrect error messages when an error occurs.
        Get-and-touch now returns ENOENT if key does not exist.

        Show
        kzeller kzeller added a comment - Added to release notes as: Get-and-touch returned incorrect error messages when an error occurs. Get-and-touch now returns ENOENT if key does not exist.

          People

          • Assignee:
            mikew Mike Wiederhold
            Reporter:
            mnunberg Mark Nunberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes