Commit 5cb7014
authored
fix: remap grpc "client error (Connect)" to UnavailableError for reconnection (#458)
grpc-js reports transport-level connection failures on streaming RPCs
as StatusCode.Unknown instead of StatusCode.Unavailable. This prevents
the client from tearing down the dead channel and triggering cluster
rediscovery when the connected node goes down.
The fix remaps errors containing "client error (Connect)" to
UnavailableError in convertToCommandError, consistent with the existing
"write after end" workaround. This ensures shouldReconnect returns true,
the channel is torn down, and discovery finds the new leader.1 parent 2da4ec9 commit 5cb7014
File tree
2 files changed
+10
-4
lines changed- packages
- db-client/src/utils
- test/src/connection/reconnect
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
714 | 714 | | |
715 | 715 | | |
716 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
717 | 724 | | |
718 | 725 | | |
719 | 726 | | |
| |||
Lines changed: 3 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
100 | 98 | | |
101 | 99 | | |
102 | 100 | | |
| |||
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
| 128 | + | |
130 | 129 | | |
131 | 130 | | |
132 | 131 | | |
| |||
135 | 134 | | |
136 | 135 | | |
137 | 136 | | |
138 | | - | |
| 137 | + | |
139 | 138 | | |
140 | 139 | | |
141 | 140 | | |
| |||
0 commit comments