# Go bingding hang at fdb.Transaction.set

**URL:** <https://forums.foundationdb.org/t/go-bingding-hang-at-fdb-transaction-set/1592>\
**Category:** Using FoundationDB\
**Created:** [August 23, 2019, 6:47am UTC](https://forums.foundationdb.org/t/go-bingding-hang-at-fdb-transaction-set/1592 "2019-08-23T06:47:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppggff](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ppggff/32/855_2.png) [@ppggff](https://forums.foundationdb.org/u/ppggff)\
**Post date:** [August 23, 2019, 6:47am UTC](https://forums.foundationdb.org/t/go-bingding-hang-at-fdb-transaction-set/1592/1 "2019-08-23T06:47:49Z")

</div>

Our go client hang when writing data to foundationdb, the stack is:

 ![fdb_set_hang](https://global.discourse-cdn.com/foundationdb/original/1X/308d0aedbffab005cd01c62755a16eef188a8e1d.jpeg)

How could this happen? The status of fdb says ‘Healthy (Rebalancing)’  
How to analyze this situation?  
Thanks a lot.

---

<div class="post-metadata">

**Author:** ![ThomasJ](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@ThomasJ](https://forums.foundationdb.org/u/ThomasJ)\
**Post date:** [August 23, 2019, 10:04pm UTC](https://forums.foundationdb.org/t/go-bingding-hang-at-fdb-transaction-set/1592/2 "2019-08-23T22:04:13Z")

</div>

You didn’t provide much details. Can you share the code?

Here is an example code for writing in

```auto
package main

import (
	"strconv"
	"time"

	"github.com/apex/log"
	"github.com/apple/foundationdb/bindings/go/src/fdb"
	"github.com/apple/foundationdb/bindings/go/src/fdb/directory"
	"github.com/apple/foundationdb/bindings/go/src/fdb/tuple"
)

func main() {
	// Different API versions may expose different runtime behaviors.

	fdb.MustAPIVersion(610)

	// Open the default database from the system cluster
	db, err := fdb.Open("./fdb.cluster", []byte("DB"))
	if err != nil {
		panic(err)
	}

	spiderDir, err := directory.CreateOrOpen(db, []string{"test"}, nil)

	if err != nil {
		panic(err)
	}

	facebookSub := spiderDir.Sub("sub")

	id := "2089982715568013122"

	_, err = db.Transact(func(tr fdb.Transaction) (ret interface{}, err error) {
		tr.Set(facebookSub.Pack(tuple.Tuple{"test", id}), []byte(strconv.FormatInt(time.Now().UnixNano(), 10)))

		return
	})

	if err != nil {
		log.Errorf("not good: %v", err)
	}

}

```

---

<div class="post-metadata">

**Author:** ![alexmiller](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/alexmiller/32/326_2.png) [@alexmiller](https://forums.foundationdb.org/u/alexmiller)\
**Post date:** [August 23, 2019, 11:06pm UTC](https://forums.foundationdb.org/t/go-bingding-hang-at-fdb-transaction-set/1592/3 "2019-08-23T23:06:22Z")

</div>

This also sounds a bit odd, as calling `set()` doesn’t involve any network communication (the key-value pair is just buffered locally), would would more strongly suggest some local issue.

---

<div class="post-metadata">

**Author:** ![ppggff](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/ppggff/32/855_2.png) [@ppggff](https://forums.foundationdb.org/u/ppggff)\
**Post date:** [August 24, 2019, 3:46am UTC](https://forums.foundationdb.org/t/go-bingding-hang-at-fdb-transaction-set/1592/4 "2019-08-24T03:46:24Z")

</div>

Thanks, I will check the local code.
