Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .cursor/rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The AI agents should never link to any issue or a pull request
in any GitHub repository in the code reviews!

The AI agents should not review AI agents' config files like CLAUDE.md or AGENTS.md!

11 changes: 9 additions & 2 deletions ballista/executor/src/execution_loop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@ use tonic::codegen::{Body, Bytes, StdError};
///
/// The loop respects the executor's concurrent task limit via a semaphore,
/// ensuring no more than the configured number of tasks run simultaneously.
///
/// `available_task_slots`, when provided, lets the caller supply the semaphore
/// controlling task concurrency (e.g. to share it across poll loops or to

@augmentcode augmentcode Bot Jun 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ballista/executor/src/execution_loop.rs:62 — The docs mention sharing this semaphore "across poll loops"; if multiple loops run concurrently, each loop will independently report num_free_slots based on available_permits(), which can lead to the scheduler over-assigning tasks relative to real capacity. It may be worth clarifying in the doc comment what coordination is expected to avoid double-counting free slots.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

/// observe executor busy state via `available_permits()`). When `None`, a
/// semaphore sized to the executor's task slots is created internally.
pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan, C>(
mut scheduler: SchedulerGrpcClient<C>,
executor: Arc<Executor>,
codec: BallistaCodec<T, U>,
available_task_slots: Option<Arc<Semaphore>>,

@augmentcode augmentcode Bot Jun 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ballista/executor/src/execution_loop.rs:69 — Now that available_task_slots can be provided externally, the later acquire().await.unwrap() / acquire_owned().await.unwrap() calls can panic if the semaphore is closed by the caller. Consider handling AcquireError and exiting (or retrying) gracefully to avoid crashing the executor.

Severity: medium

Other Locations
  • ballista/executor/src/execution_loop.rs:97
  • ballista/executor/src/execution_loop.rs:144

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

) -> Result<(), BallistaError>
where
C: tonic::client::GrpcService<tonic::body::Body>,
Expand All @@ -75,8 +81,9 @@ where
.unwrap()
.clone()
.into();
let available_task_slots =
Arc::new(Semaphore::new(executor_specification.task_slots as usize));
let available_task_slots = available_task_slots.unwrap_or_else(|| {
Arc::new(Semaphore::new(executor_specification.task_slots as usize))
});

let (task_status_sender, mut task_status_receiver) =
std::sync::mpsc::channel::<TaskStatus>();
Expand Down
1 change: 1 addition & 0 deletions ballista/executor/src/executor_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@ pub async fn start_executor_process(
scheduler.clone(),
executor.clone(),
default_codec,
None, // available_task_slots: use internal semaphore
)));
}
};
Expand Down
2 changes: 1 addition & 1 deletion ballista/executor/src/standalone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub async fn new_standalone_executor_from_builder(
)),
);

tokio::spawn(execution_loop::poll_loop(scheduler, executor, codec));
tokio::spawn(execution_loop::poll_loop(scheduler, executor, codec, None));
Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion examples/examples/mtls-cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ async fn run_executor() -> Result<(), Box<dyn std::error::Error>> {
// This registers the executor and starts polling for tasks
info!("Starting execution poll loop...");
let poll_handle = tokio::spawn(async move {
execution_loop::poll_loop(scheduler, executor, codec).await
execution_loop::poll_loop(scheduler, executor, codec, None).await
});

tokio::select! {
Expand Down
Loading