Uploaded image for project: 'Couchbase Go SDK'
  1. Couchbase Go SDK
  2. GOCBC-1013

Gocbcore not returning stats if they do not have keys

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • core-9.1.0
    • None
    • core-library
    • None
    • 1

    Description

      Version: gocbcore v9.0.7
      Couchbase server version: 7.0.0

      Problem
      If the returned stat response has no key then gocbcore ignores the returned value. This is the incorrect behaviour as the binary documentation says

      The sequence of return packets is terminated with a packet that contains no key and no value.

      But looking at the gocbcore code we have

      // Check if the key length is zero.  This indicates that we have reached
      // the ending of the stats listing by this server.
      if len(resp.Key) == 0 {
      	// As this is a persistent request, we must manually cancel it to remove
      	// it from the pending ops list.  To ensure we do not race multiple cancels,
      	// we only handle it as completed the one time cancellation succeeds.
      	if req.internalCancel(err) {
      		opHandledLocked()
      	}
       
      	return
      }
      

      The expectation would be to be able to retrieve the stat responses with no key.

      Steps to reproduce
      1. Setup a dev cluster running CC
      2. Run the provided program which just prints out the connections stats

      What you would expect is to get the information about the connections instead you get

      RESULTS: &{Servers:map[localhost:12000:{Stats:map[] Error:<nil>}]}
      

      But if you use wireshark you can see that Couchbase server did send the data but Gocbcore did not process it. As seen below

      Attachments

        For Gerrit Dashboard: GOCBC-1013
        # Subject Branch Project Status CR V

        Activity

          People

            charles.dixon Charles Dixon
            carlos.gonzalez Carlos Gonzalez Betancort (Inactive)
            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