Description
The SDK HELO version seems incorrect.
Steps to reproduce:
- Spin up a one node cluster with the default bucket
- Use the following Go code
package main
import (
"fmt"
"gopkg.in/couchbase/gocb.v1"
)
type User struct {
Id string `json:"uid"`
Email string `json:"email"`
Interests []string `json:"interests"`
}
func main() {
gocb.SetLogger(gocb.DefaultStdioLogger())
cluster, _ := gocb.Connect("couchbase://localhost")
bucket, _ := cluster.OpenBucket("default", "")
bucket.Upsert("u:kingarthur",
User{
Id: "kingarthur",
Email: "kingarthur@couchbase.com",
Interests: []string{"Holy Grail", "African Swallows"},
}, 0)
var inUser User
bucket.Get("u:kingarthur", &inUser)
fmt.Printf("User: %v\n", inUser)
}
- build and execute
- Tail the memcached.log:
2017-11-10T18:26:58.200201Z NOTICE 43: HELO [gocb/v7.0.5] [ 10.111.163.1:64882 - 10.111.163.101:11207 ]
2017-11-10T18:26:58.205011Z WARNING 43 Closing connection [ 10.111.163.1:64882 - 10.111.163.101:11207 ] due to read error: Connection reset by peer
As you can see the HELO version of the SDK is gocb/v7.0.5 I was expecting 1.30, as I believe that is the SDK version being used.
Hey Patrick Varley,
The Go SDK is actually made up of two somewhat independently developed projects, gocbcore which implements all of the connection, protocol and configuration management, as well as gocb on top which provides a more sane API for developers to use. The version which is reported to the server is the gocbcore version (as this is the one which would actually impact the behaviour of the client). Note that the reason we cannot send the gocb version is that there is no way to map a specific gocb version to a specific gocbcore version due to how Go's package management works. For instance, if you checked out gocb last month, you would get gocb.v1.3.0 and gocbcore v7.0.4. However, doing the exact same installation today would yield instead gocb.v1.3.0 and gocbcore v7.0.5. Note that the gocb version hasn't been updated, but gocbcore underneath has been.
Cheers, Brett