Commit 512d4a2
committed
core: Don't set firstPass=true on address update in pick_first
Updating the addresses has no bearing if pick_first is doing the first
pass, for the sake of when refreshNameResolution() is triggered. In the
first pass pick_first is in CONNECTING and after the first pass it is in
TRANSIENT_FAILURE. If pick_first already did a first pass and is in TF,
then when it gets updated addresses it _stays_ in TF and the regular
"We will count the number of connection failures, and when that number
reaches the number of subchannels, we will request re-resolution" should
apply. Setting firstPass=true on each address update can cause us to
request refreshes too frequently.
So we only need to adjust firstPass when changing the
rawConnectivityState. And if we do that, we don't actually need
firstPass; we can use numTf instead.1 parent fa7b52b commit 512d4a2
2 files changed
Lines changed: 20 additions & 12 deletions
File tree
- core/src
- main/java/io/grpc/internal
- test/java/io/grpc/internal
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | 72 | | |
74 | 73 | | |
75 | 74 | | |
| |||
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 122 | | |
127 | 123 | | |
128 | 124 | | |
| |||
340 | 336 | | |
341 | 337 | | |
342 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
343 | 342 | | |
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
| 346 | + | |
| 347 | + | |
347 | 348 | | |
348 | 349 | | |
349 | 350 | | |
| |||
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | | - | |
376 | | - | |
377 | | - | |
| 376 | + | |
| 377 | + | |
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
| |||
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1940 | 1940 | | |
1941 | 1941 | | |
1942 | 1942 | | |
| 1943 | + | |
1943 | 1944 | | |
1944 | 1945 | | |
1945 | 1946 | | |
| |||
1949 | 1950 | | |
1950 | 1951 | | |
1951 | 1952 | | |
| 1953 | + | |
1952 | 1954 | | |
1953 | 1955 | | |
1954 | 1956 | | |
| |||
1961 | 1963 | | |
1962 | 1964 | | |
1963 | 1965 | | |
1964 | | - | |
1965 | | - | |
1966 | | - | |
1967 | | - | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
1968 | 1971 | | |
1969 | 1972 | | |
1970 | 1973 | | |
1971 | 1974 | | |
1972 | 1975 | | |
1973 | 1976 | | |
1974 | 1977 | | |
1975 | | - | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
1976 | 1984 | | |
1977 | 1985 | | |
1978 | 1986 | | |
| |||
0 commit comments