Commit 93ae1b8
authored
fix: try again to fix Miri in ParquetOpener (#21680)
## Which issue does this PR close?
- Closes #21662.
## Rationale for this change
#21663 removed the nested async block in
`PushDecoderStreamState::transition` to fix a Stacked Borrows violation
under miri. However, miri still flags the same violation because `&mut
self` is still a single opaque borrow — inlining the async block alone
doesn't let miri split the disjoint field borrows across the `.await`
yield point.
Comet CI reproduces this reliably:
https://github.com/apache/datafusion-comet/actions/runs/24518967597/job/71671004017?pr=3916
## What changes are included in this PR?
Change `PushDecoderStreamState::transition` to take `self` by value
instead of `&mut self`. With `&mut self`, the generated future stores a
mutable reference, and when `unfold` pins and polls it, miri sees the
`&mut self` as a single opaque borrow that conflicts across the `.await`
yield point. With owned `self`, the future owns the state directly — no
reference means no Stacked Borrows conflict. The struct fields are all
heap-allocated or reference-counted, so the move is just pointer-sized
copies, not a deep copy.
## Are these changes tested?
Existing tests cover this code path. The fix is validated by miri
passing in CI (the same test that currently fails:
`test_nested_types_extract_missing_struct_names_missing_field`). We'll
run Comet CI against this branch first to confirm the miri violation is
resolved before merging.
## Are there any user-facing changes?
No.1 parent 7731130 commit 93ae1b8
1 file changed
Lines changed: 13 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1199 | 1199 | | |
1200 | 1200 | | |
1201 | 1201 | | |
1202 | | - | |
1203 | | - | |
1204 | | - | |
1205 | | - | |
| 1202 | + | |
1206 | 1203 | | |
1207 | 1204 | | |
1208 | 1205 | | |
| |||
1248 | 1245 | | |
1249 | 1246 | | |
1250 | 1247 | | |
1251 | | - | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1252 | 1254 | | |
1253 | 1255 | | |
1254 | 1256 | | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
1259 | | - | |
1260 | 1257 | | |
1261 | 1258 | | |
1262 | 1259 | | |
| |||
1265 | 1262 | | |
1266 | 1263 | | |
1267 | 1264 | | |
1268 | | - | |
| 1265 | + | |
1269 | 1266 | | |
1270 | 1267 | | |
1271 | | - | |
| 1268 | + | |
1272 | 1269 | | |
1273 | 1270 | | |
1274 | 1271 | | |
1275 | 1272 | | |
1276 | 1273 | | |
1277 | 1274 | | |
1278 | 1275 | | |
1279 | | - | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
1280 | 1279 | | |
1281 | 1280 | | |
1282 | 1281 | | |
1283 | 1282 | | |
1284 | 1283 | | |
1285 | | - | |
| 1284 | + | |
1286 | 1285 | | |
1287 | 1286 | | |
1288 | 1287 | | |
| |||
0 commit comments