Commit 02c24dd
committed
fix: remap grpc "client error (Connect)" to UnavailableError for reconnection
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 efd197f commit 02c24dd
File tree
2 files changed
+12
-4
lines changed- packages
- db-client/src/utils
- test/src/connection/reconnect
2 files changed
+12
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
655 | 662 | | |
656 | 663 | | |
657 | 664 | | |
| |||
Lines changed: 5 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
90 | 92 | | |
91 | 93 | | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | 98 | | |
97 | | - | |
98 | | - | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| |||
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments