Commit c9c9456
authored
Fixes #1398.
`_cache_dbr_capabilities` was caching
`DBRCapabilities(dbr_version=None)` when `_query_dbr_version()` failed,
and the idempotency guard then blocked every retry — silently disabling
all version-gated features for the life of the process.
Fix: apply the same `None`-guard already used by the sibling
`_try_cache_dbr_capabilities`, and switch the downstream read in
`open()` to `.get(..., DBRCapabilities())` so a now-possibly-missing
entry doesn't `KeyError`. Failure-case behavior is unchanged for the
current connection; subsequent `open()` calls can now retry instead of
staying stuck.
Follow-ups tracked in #1413.
## Test plan
- [x] `hatch run unit tests/unit/test_connection_manager.py` — 745 pass.
- [x] New `TestCacheDbr` regression mirrors `TestTryCacheDbr` + a
`test_retry_succeeds_after_transient_failure` case specific to #1398
(verified it fails on `main`, passes with the fix).
- [ ] CI functional run.
1 parent ff4f80b commit c9c9456
3 files changed
Lines changed: 36 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
193 | 194 | | |
194 | 195 | | |
195 | 196 | | |
196 | | - | |
197 | | - | |
| 197 | + | |
| 198 | + | |
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
204 | | - | |
205 | | - | |
| 204 | + | |
206 | 205 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
219 | 210 | | |
220 | 211 | | |
221 | 212 | | |
| |||
306 | 297 | | |
307 | 298 | | |
308 | 299 | | |
309 | | - | |
| 300 | + | |
310 | 301 | | |
311 | 302 | | |
312 | 303 | | |
| |||
507 | 498 | | |
508 | 499 | | |
509 | 500 | | |
510 | | - | |
| 501 | + | |
511 | 502 | | |
512 | | - | |
| 503 | + | |
513 | 504 | | |
514 | 505 | | |
515 | 506 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
100 | | - | |
| 99 | + | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 112 | + | |
116 | 113 | | |
117 | 114 | | |
118 | 115 | | |
119 | | - | |
| 116 | + | |
120 | 117 | | |
121 | 118 | | |
122 | 119 | | |
| |||
127 | 124 | | |
128 | 125 | | |
129 | 126 | | |
130 | | - | |
| 127 | + | |
131 | 128 | | |
132 | 129 | | |
133 | 130 | | |
| |||
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
147 | | - | |
| 144 | + | |
148 | 145 | | |
149 | 146 | | |
150 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
0 commit comments