Commit 6c4a3d6
fix: grpc calls block forever when service entry does not exist in consul
When no service entry in consul existed for the service that should be resolved,
no result was reported to the ClientConn (UpdateState() wasn't called).
This caused that the GRPC channel got stuck in CONNECTING state.
When a GRPC call was done on the connection it was blocking forever because the
channel was still trying to establish the connection.
Calling UpdateState() with an empty set of addresses on the first try, when
consul reported no addresses, transitions the channel state to
TRANSIENT_FAILURE. This allows GRPC calls on the connection to fail with an
UNAVAILABLE error.1 parent d44f9b6 commit 6c4a3d6
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | | - | |
187 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
121 | 128 | | |
122 | 129 | | |
123 | 130 | | |
| |||
0 commit comments