We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6dcaf46 commit e8f53f6Copy full SHA for e8f53f6
1 file changed
datafusion/physical-plan/src/joins/grace_hash_join/stream.rs
@@ -990,7 +990,21 @@ impl GraceHashJoinStream {
990
};
991
if bytes_to_free > 0 {
992
let mut res = reservation.lock();
993
- res.shrink(bytes_to_free);
+ let available = res.size();
994
+ if bytes_to_free > available {
995
+ // Don't panic on accounting drift; free what we can and log.
996
+ let shrink = available;
997
+ if shrink > 0 {
998
+ res.shrink(shrink);
999
+ }
1000
+ debug!(
1001
+ "Grace hash join reservation underflow: attempted to free {}, but reservation size is {}",
1002
+ human_readable_size(bytes_to_free),
1003
+ human_readable_size(available)
1004
+ );
1005
+ } else {
1006
+ res.shrink(bytes_to_free);
1007
1008
}
1009
*left_fut = None;
1010
*right_fut = None;
0 commit comments