CivilizedCrab
CivilizedCrab

Reputation: 95

Golang hedera sdk testnet "Client received GoAway with error code ..."

I am trying to connect to hedera test net. I followed the docs and created a account and used

hederaClient := hederaSdk.ClientForTestnet()
hederaClient.SetOperator(cfg.Hedera.OperatorID, cfg.Hedera.OperatorKey)

This snippet to try and connect to hedera network. But it throws "ERROR: [transport] Client received GoAway with error code ENHANCE_YOUR_CALM and debug data equal to ASCII "too_many_pings"."

i found out that this is a problem with grpc connection but i am opening only one connection and didn't change any settings in the connection.

my go version is 1.20 and hedera sdk is v2.24.3

Upvotes: 4

Views: 3951

Answers (2)

Long delay between beats in stream. Make beats more faster. It solved issue for me.

Upvotes: 0

Richard Bair
Richard Bair

Reputation: 71

For some background, grpc is built on top of HTTP/2. In HTTP/2, you can have multiple interleaved concurrent requests on a single connection. Each of these unique requests is called a "stream". Hedera is configured to support a maximum of 10 concurrent streams (requests) per connection.

The main reason for a limit is to control the total memory usage across all connections. Maybe Hedera can raise the limit, maybe not. In either case, a client has to be prepared to handle the case.

The client in this case got a GOAWAY and ENHANCE_YOUR_CALM because it was trying to send way more concurrent streams than permitted. It should be that the SDKs handle this transparently so the client application doesn't ever encounter this. If that is not the case, then I would first see if the SDK has a bug.

Upvotes: 2

Related Questions