Skip to content

Commit

Permalink
Avoid issue with probe threads counter wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkharderdev committed Sep 14, 2024
1 parent 3a6725f commit 8b48588
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datafusion/physical-plan/src/joins/hash_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ impl JoinLeftData {
/// Decrements the counter of running threads, and returns `true`
/// if caller is the last running thread
fn report_probe_completed(&self) -> bool {
self.probe_threads_counter.fetch_sub(1, Ordering::Relaxed) == 1
self.probe_threads_counter.load(Ordering::Relaxed) == 0
|| self.probe_threads_counter.fetch_sub(1, Ordering::Relaxed) == 1
}
}

Expand Down

0 comments on commit 8b48588

Please sign in to comment.