grpc / grpc/grpc-java

Clarify NameResolver.Listener behavior/expectations when the servers remain the same

Offen
#6,524 9 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @ejona86 Auf GitHub ansehen
docs enhancement
Vorherrschende Sprache
Java
Sterne
12.1k
Forks
4k
Ø Merge
2 T. 17 Std.
Gemergte PRs (30 T.)
37

Beschreibung

### Is your feature request related to a problem?

I have a (Spring) discovery service based `NameResolver` which sends regular updates/ticks to the application, however it does not contain details which service name might have changed. So I have to check them for updates frequently, even if only one is service updated.

Should I verify whether the server addresses remained the same before invoking `onAddresses`/ `onResult`? How expensive is calling the method with the same servers over and over again? Does it trigger new connections to be made?

### Describe the solution you'd like

Javadocs that explain what the listener will/are supposed to do if they get (partially) the same addresses.

Either:

````
The listener will create a diff with any previous server list and prepare (close) connections for the new (old) servers
````

Or:

````
`NameResolver`s are discouraged from calling this method if the result hasn't changed from before.
````

### Additional context

Ref #1770
Related #6523

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.