Replace oneshot channel with JoinHandle in IndexReader prefetch#21744
Replace oneshot channel with JoinHandle in IndexReader prefetch#21744himshikhagupta wants to merge 1 commit into
Conversation
PR Reviewer Guide 🔍(Review updated until commit 3fecbee)Here are some key observations to aid the review process:
|
|
❌ Gradle check result for 431aaf4: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
IndexReader used a oneshot channel between spawn_blocking and the poll loop for row group prefetch. When the blocking task panicked (e.g. DelegationPossible reaching subtree_cost in the bitmap tree evaluator), the sender was dropped without sending. The Poll::Ready(Err(_)) arm retried unconditionally, creating an infinite loop that left the Java search thread stuck on future.join() forever. Replace the oneshot channel with JoinHandle from spawn_blocking, which provides explicit panic detection via JoinError::is_panic(): - Panic: propagate immediately as DataFusionError with the panic message - Cancelled (runtime shutdown): retry (transient, preserves existing behavior) This also fixes waker registration: JoinHandle properly wakes the parent task on completion, unlike the oneshot pattern which required the receiver to be polled before it could register a waker. Signed-off-by: Himshikha Gupta <himshikh@amazon.com>
431aaf4 to
3fecbee
Compare
|
Persistent review updated to latest commit 3fecbee |
|
❌ Gradle check result for 3fecbee: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
IndexReader used a oneshot channel between spawn_blocking and the poll loop for row group prefetch. When the blocking task panicked (e.g. DelegationPossible reaching subtree_cost in the bitmap tree evaluator), the sender was dropped without sending. The Poll::Ready(Err(_)) arm retried unconditionally, creating an infinite loop that left the Java search thread stuck on future.join() forever.
Replace the oneshot channel with JoinHandle from spawn_blocking, which provides explicit panic detection via JoinError::is_panic():
This also fixes waker registration: JoinHandle properly wakes the parent task on completion, unlike the oneshot pattern which required the receiver to be polled before it could register a waker.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.