Skip to content

Commit 868cc77

Browse files
authored
Merge pull request #44 from datafusion-contrib/lia/add-guard-to-avoid-panic
Add guard to avoid panic
2 parents 3c1ff7f + 7e0c775 commit 868cc77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/planning.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,10 @@ pub async fn distribute_stages(
451451
.collect();
452452

453453
for attempt in 0..3 {
454+
if workers.is_empty() {
455+
return Err(anyhow!("No workers available to distribute stages").into());
456+
}
457+
454458
// all stages to workers
455459
let (task_datas, final_addrs) =
456460
assign_to_workers(query_id, &stages, workers.values().collect())?;

0 commit comments

Comments
 (0)