go-micro
go-micro copied to clipboard
Infinite retry
srv
func (u *Users) Read(ctx context.Context, req *pb.ReadRequest, rsp *pb.ReadResponse) error {
// ...
return errors.InternalServerError("DATABASE_ERROR", "Error connecting to the database")
}
If an error is returned, it will retry until timeout
@asim hi
Go-micro will retry failed request by default, you disable it by setting MICRO_CLIENT_RETRIES=0.
Go-micro will retry failed request by default, you disable it by setting MICRO_CLIENT_RETRIES=0. hi @xpunch
After testing, it is found that the following two cannot be solved
client.Retries(0)
export MICRO_CLIENT_RETRIES=0
The details of the issue and the PR are here https://github.com/asim/go-micro/issues/2110
We can only solve it by modifying the sendResponse method by ourselves, hoping to fix this bug