Commit 5fe3ca7
authored
chore: updates datasources to report recoverability in errors (#208)
**Requirements**
- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform
versions
Didn't do yet, going to do as part of overall benchtesting before
release.
Adds tracking of Recover-ability on data source ErrorInfo so that can be
communicated outward by datasources. Then the FDv2 datasource can
blacklist conditionally on the recover-ability of the error. This now
allows data sources to report Off (intentional shutdown) without getting
blacklisted.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Add `Recoverable` to `DataSourceStatus.ErrorInfo` and propagate it
across all data sources to drive `Interrupted` vs `Off`, conditional
FDv2 blacklisting/fallback, and improved shutdown handling; update tests
accordingly.
>
> - **Interfaces**
> - Add `bool Recoverable` to `DataSourceStatus.ErrorInfo` and include
it in `FromException`/`FromHttpError`.
> - **Data Sources**
> - **Polling/Streaming (FDv1 & FDv2)**:
> - Compute recoverability via `HttpErrors.IsRecoverable` and populate
`ErrorInfo` (set `Recoverable=true` for `InvalidData`/`StoreError`).
> - Route status: `Interrupted` for recoverable, `Off` for
unrecoverable; pass `ErrorInfo` to status updates.
> - Add `Shutdown(ErrorInfo?)` with atomic guard; update `Dispose` to
call shutdown and avoid duplicate work; ensure `Off` status on shutdown.
> - For unrecoverable init errors, complete init with `false`.
> - **FDv2**:
> - Honor `FDv1Fallback` header; blacklist current synchronizer only
when error is unrecoverable.
> - **Tests**
> - Update/extend tests to assert `Recoverable` semantics,
`FDv1Fallback`, status transitions (`Interrupted` vs `Off`), init task
results, and shutdown behavior; add waits for async status updates.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c56e407. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 3b7e68e commit 5fe3ca7
File tree
15 files changed
+404
-89
lines changed- pkgs/sdk/server
- src
- Interfaces
- Internal
- DataSources
- FDv2DataSources
- test
- Integrations
- Internal
- DataSources
- FDv2DataSources
15 files changed
+404
-89
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
| |||
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| 99 | + | |
93 | 100 | | |
94 | | - | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
98 | | - | |
| 105 | + | |
| 106 | + | |
99 | 107 | | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
| 113 | + | |
105 | 114 | | |
106 | | - | |
| 115 | + | |
107 | 116 | | |
108 | 117 | | |
109 | 118 | | |
110 | | - | |
| 119 | + | |
| 120 | + | |
111 | 121 | | |
112 | 122 | | |
113 | 123 | | |
| |||
Lines changed: 37 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | | - | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | | - | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
94 | | - | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
98 | | - | |
| 101 | + | |
99 | 102 | | |
100 | 103 | | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | | - | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
116 | 121 | | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
120 | 125 | | |
121 | 126 | | |
122 | | - | |
123 | | - | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
127 | 132 | | |
128 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
129 | 137 | | |
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
134 | 142 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
138 | 147 | | |
139 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
140 | 161 | | |
141 | 162 | | |
142 | 163 | | |
| |||
Lines changed: 40 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
107 | 113 | | |
108 | 114 | | |
109 | 115 | | |
110 | 116 | | |
111 | 117 | | |
112 | 118 | | |
113 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
114 | 136 | | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
| 137 | + | |
120 | 138 | | |
| 139 | + | |
121 | 140 | | |
122 | 141 | | |
123 | 142 | | |
| |||
175 | 194 | | |
176 | 195 | | |
177 | 196 | | |
178 | | - | |
| 197 | + | |
| 198 | + | |
179 | 199 | | |
180 | 200 | | |
181 | 201 | | |
| |||
187 | 207 | | |
188 | 208 | | |
189 | 209 | | |
190 | | - | |
| 210 | + | |
| 211 | + | |
191 | 212 | | |
192 | 213 | | |
193 | 214 | | |
| |||
210 | 231 | | |
211 | 232 | | |
212 | 233 | | |
213 | | - | |
214 | 234 | | |
215 | 235 | | |
216 | 236 | | |
217 | 237 | | |
218 | 238 | | |
219 | | - | |
| 239 | + | |
| 240 | + | |
220 | 241 | | |
221 | | - | |
| 242 | + | |
222 | 243 | | |
223 | | - | |
224 | 244 | | |
225 | 245 | | |
226 | 246 | | |
| |||
230 | 250 | | |
231 | 251 | | |
232 | 252 | | |
233 | | - | |
| 253 | + | |
234 | 254 | | |
235 | 255 | | |
236 | 256 | | |
237 | 257 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
242 | 264 | | |
243 | 265 | | |
244 | 266 | | |
245 | 267 | | |
246 | 268 | | |
247 | | - | |
| 269 | + | |
248 | 270 | | |
249 | 271 | | |
250 | 272 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| |||
0 commit comments