Skip to content

Commit 604bc33

Browse files
alambariel-miculas
andauthored
[branch-53] fix: use try_shrink instead of shrink in try_resize (#20424) (#20890)
- Part of #19692 This PR: - Backports #20424 from @ariel-miculas to the branch-53 line Co-authored-by: Ariel Miculas-Trif <ariel.miculas@gmail.com>
1 parent 2c0a38b commit 604bc33

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • datafusion/execution/src/memory_pool

datafusion/execution/src/memory_pool/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,9 @@ impl MemoryReservation {
434434
let size = self.size.load(atomic::Ordering::Relaxed);
435435
match capacity.cmp(&size) {
436436
Ordering::Greater => self.try_grow(capacity - size)?,
437-
Ordering::Less => self.shrink(size - capacity),
437+
Ordering::Less => {
438+
self.try_shrink(size - capacity)?;
439+
}
438440
_ => {}
439441
};
440442
Ok(())

0 commit comments

Comments
 (0)