Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpc: use the loopback conn also for GRPCDialOptions
For context, `rpc.GRPCDialOptions` is used in two cases: - when connecting to other nodes as specified by the `--join` flag. - in the grpc-gateway code, to route incoming HTTP requests to the RPC subsystem. The first one nearly always targets remotes nodes. The second one always targets the local node (it's a loopback connection). Prior to this patch, the 2 callers to `rpc.GRPCDialOptions` would be served the regular "remote network conn" dial options unconditionally, including the backoff, only-once-dialer and other parameters suitable to connect to other nodes remotely. While this choice is suitable for the `--join` logic, it's not suitable for the grpc-gateway loopback conn. In that case, we want to avoid all the network intelligence and especially avoid the only-once-dialer and circuit breaker. This patch ensures that grpc-gateway receives the loopback parameters properly. Release note (bug fix): A bug was fixed whereby under high CPU load, HTTP requests to certain API endpoints (e.g. the health endpoint) could start failing and then never succeed again until the node was restarted. This bug had been introduced in v23.1.
- Loading branch information