Commit 37defbb
committed
[A76] Clarify behaviors discovered during implementation
I discovered a few behaviors that I'm not sure are desired (although I don't
think they are harmful either), and that may cause confusion for implementors,
so definitely worth noting:
1. If multiple concurrent RPCs use the same picker, and the picker has no
endpoint in connecting state, then both may trigger a connection attempt,
resulting in multiple endpoints leaving Idle. This happens until the picker
is updated to update `picker_has_endpoint_in_connecting_state`. One thing we
could do to avoid this, at least in Go, is to atomically set
`picker_has_endpoint_in_connecting_state` to true when we trigger a
connection attempt.
2. If we queued the pick because there was no endpoint in `Ready` state and
there was endpoints in `Idle` or connecting state, then when the endpoint
transitions to Ready, we may end up triggering a connection attempt again on
the next pick for a given RPC.
3. The behavior is not specified when multiple endpoints have the same hash key.
Looking at Envoy's code, I think there is no deliberate choice of endpoint in
that case, so we could leave it unspecified, but I think it's worth
clarifying.1 parent dea04cb commit 37defbb
1 file changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
165 | 173 | | |
166 | 174 | | |
167 | 175 | | |
| |||
178 | 186 | | |
179 | 187 | | |
180 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
181 | 193 | | |
182 | 194 | | |
183 | 195 | | |
| |||
230 | 242 | | |
231 | 243 | | |
232 | 244 | | |
233 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
234 | 248 | | |
235 | 249 | | |
236 | 250 | | |
| |||
0 commit comments