Uploaded image for project: 'Java Couchbase JVM Core'
  1. Java Couchbase JVM Core
  2. JVMCBC-41

Unable decode value as JSON after restarting the server

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.0.1
    • 1.0.0
    • None
    • None

    Description

      Steps to reproduce:

      public class Demo {
      public static void main(String[] args) {
      CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder()
      .kvTimeout(100)
      .bootstrapCarrierEnabled(false)
      .bootstrapHttpEnabled(true)
      .build();
      Cluster cluster = CouchbaseCluster.create(env);
      Bucket bucket = cluster.openBucket("default");
      bucket.upsert(JsonDocument.create("foo", JsonObject.create().put("foo", "bar")));
      long sleepMillis = 1000;
      while (true) {
      try

      { bucket.get("foo"); Thread.sleep(sleepMillis); }

      catch (Exception e)

      { e.printStackTrace(); }

      }
      }
      }

      The class above runs infite requests to the cluster. After some time we are stopping the cluster and then restarting it.

      Observed behaviour:
      1) After restoring connection, the library starts complaining that it cannot decode the value because of broken flags.
      2) Everything is clear on wires: i.e. flags 0x02000000 as expected
      3) In the library flags are 2065852015 (or 7b22666f in hex), which is {"fo in ascii and clearly says that the library is trying to interpret value as flags

      The problem:
      The extras ByteBuf was not properly refcounted

      Attachments

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

        Activity

          People

            daschl Michael Nitschinger
            avsej Sergey Avseyev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty