grpc / grpc/grpc-java

Document multiple EquivalentAddressGroups vs multiple SocketAddresses in NameResolver

オープン
#5,263 コメント 2 件 リアクション 2 件 担当者 1 名 @zhangkun83 が担当を希望しています GitHub で見る
主要言語
Java
スター
12.1k
フォーク
4k
平均マージ
2日 17時間
マージ済み PR(30日)
37

説明

Currently the javadocs don't state when to use multiple `EquivalentAddressGroup`s or multiple `SocketAddress`es in a single `EquivalentAddressGroup`.

**io.grpc.EquivalentAddressGroup**

> A group of SocketAddresses that are considered equivalent when channel makes connections.
>
> Usually the addresses are addresses resolved from the same host name, and connecting to any of them is equally sufficient. They do have order. An address appears earlier on the list is likely to be tried earlier.

**io.grpc.NameResolver.Listener.onAddresses(List, Attributes)**

> Handles updates on resolved addresses and attributes.
>
> Implementations will not modify the given servers.
>
> **Parameters:**
> - **servers** the resolved server addresses. An empty list will trigger onError
> - **attributes** extra information from naming system.

* Do I use multiple `SocketAddress`es if there are multiple paths to one and the same server, such as `10.1.2.3` , `127.0.0.1` or `::1`? (Would that ever happen?)
* Or do I always create new `EquivalentAddressGroup`s for each address? (But then why am I able to list more addresses?)

It is also unsure when (and for what) the attributes on the single `EquivalentAddressGroup` is used and when (and for what) the attributes from the `onAddresses` call is used, and finally whether they are merged somehow or not.

## Affects

* grpc-core

## Related

* https://github.com/grpc/grpc-java/issues/1770
* https://github.com/grpc/grpc-java/issues/4302
* https://github.com/grpc/grpc-java/issues/5213

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。