It looks like the driver is steadily leaking goroutines and memory. The following code demonstrates this. The number of goroutines steadily increases as does the memory, simply by holding an open bucket
package main import ( "fmt" "github.com/couchbaselabs/gocb" "os" "runtime" "runtime/pprof" "time" ) func main() { bucketName := "test" cluster, err := gocb.Connect("couchbase://localhost:8091") if err != nil { print(err.Error()) os.Exit(1) } bucket, err := cluster.OpenBucket(bucketName, "") if err != nil { print(err.Error()) os.Exit(1) } println("Connected to bucket %s", bucket) var memStats runtime.MemStats for { println("\n\n\n") println(fmt.Sprintf("Number of running goroutines: %d", runtime.NumGoroutine())) runtime.ReadMemStats(&memStats) println(fmt.Sprintf("Allocated memory still in use: %dk", memStats.Alloc/1024)) println("\n\nDump >>>>>>>>>>>>>>>>>>>>>>") pprof.Lookup("goroutine").WriteTo(os.Stdout, 1) time.Sleep(5 * time.Second) } }
Running the code shows that the goroutines are accumulating here:
github.com/couchbaselabs/gocb/gocbcore.(*memdQueue).drainTillSignal+0x13c
The issues are disabled for the driver repo; is this the right channel to raise this problem?