Nakama Unity client retry only specific errors

We are using nakama unity client global retry configuration. It’s good and gets the job done.

But is there a way retry only specific errors? using this library?

I’m checking the implementation and I think it’s not supported. Let me know if I misunderstood it.

We want to do something like pass a list of exceptions in RetryConfiguration that should be tried and other exception will be ignored and won’t be retried?

var retryConfiguration = new Nakama.RetryConfiguration(baseDelay: 1, maxRetries: 5, delegate { System.Console.Writeline("about to retry."); });

But checking the implementation here, it seems something we could not do right now?

Hey @dslizardo could you explain a bit more about your use case? What is insufficient about the current set of exceptions that we catch? We intentionally do not allow you to override this as the exceptions that get bubbled up are very specific to our network adapters and the underlying platform.

Also note – we don’t retry all errors. We only retry “transient” errors, i.e., errors we suspect our due to poor connectivity or a temporary increase in server load. The exception in the line of code you highlighted is actually filtered through additional logic that is specific to the network adapter.

@lugehorsam I see, thanks for clarifying on what requests are being retried.

So we implemented custom RPCs in nakama and we use client.RpcAsync to call these RPCs and these RPCs return game specific errors and we want to skip some of these errors for being retried.

I see. So unless the error is in the 500 range or the client times out, there will be no retry:

Understood. Saw that a while ago.

I’m taking a look if we could update the status code in our game sever. We used the Go runtime and simply returning return fmt.Errorf("error here") but it seems we could use nakama-common/runtime.go at 084a42e349c40691520220490e0d8cf2551a7fa5 · heroiclabs/nakama-common · GitHub

That looks like the right approach to me.

1 Like