Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix latest commit #379

Merged
merged 9 commits into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions ballista/executor/src/execution_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
info!("Starting poll work loop with scheduler");

loop {
// Keeps track of whether we received task in last iteration
// to avoid going in sleep mode between polling
let mut active_job = false;

let can_accept_task = available_tasks_slots.load(Ordering::SeqCst) > 0;

// Don't poll for work if we can not accept any tasks
Expand Down Expand Up @@ -99,21 +103,24 @@ pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
)
.await
{
Ok(_) => {}
Ok(_) => {
active_job = true;
}
Err(e) => {
warn!("Failed to run task: {:?}", e);
active_job = false;
}
}
} else {
active_job = false
}
}
Err(error) => {
warn!("Executor poll work loop failed. If this continues to happen the Scheduler might be marked as dead. Error: {}", error);
}
}

if available_tasks_slots.load(Ordering::SeqCst)
== executor_specification.task_slots as usize
{
if !active_job {
tokio::time::sleep(Duration::from_millis(100)).await;
}
}
Expand Down