fix: try again to fix Miri in ParquetOpener#21680
Merged
mbutrovich merged 2 commits intoapache:mainfrom Apr 16, 2026
Merged
Conversation
mbutrovich
added a commit
to mbutrovich/datafusion-comet
that referenced
this pull request
Apr 16, 2026
Contributor
Author
|
Testing the fix in Comet CI: apache/datafusion-comet#3960 |
Contributor
Author
|
Miri is green in Comet CI with the latest commit: https://github.com/apache/datafusion-comet/actions/runs/24522903075/job/71685242268?pr=3960 |
comphead
reviewed
Apr 16, 2026
| let result = self.project_batch(&batch); | ||
| timer.stop(); | ||
| return Some(result); | ||
| // Release the borrow on baseline_metrics before moving self |
comphead
approved these changes
Apr 16, 2026
Contributor
comphead
left a comment
There was a problem hiding this comment.
Thanks @mbutrovich IMO it is good to go.
alamb
reviewed
Apr 16, 2026
| /// - [`Finished`](DecodeResult::Finished) – signals end-of-stream (`None`). | ||
| async fn transition(&mut self) -> Option<Result<RecordBatch>> { | ||
| /// | ||
| /// Takes `self` by value (rather than `&mut self`) so the generated future |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
PushDecoderStreamState::transition#21662.Rationale for this change
#21663 removed the nested async block in
PushDecoderStreamState::transitionto fix a Stacked Borrows violation under miri. However, miri still flags the same violation because&mut selfis still a single opaque borrow — inlining the async block alone doesn't let miri split the disjoint field borrows across the.awaityield 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::transitionto takeselfby value instead of&mut self. With&mut self, the generated future stores a mutable reference, and whenunfoldpins and polls it, miri sees the&mut selfas a single opaque borrow that conflicts across the.awaityield point. With ownedself, 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.