tfeda commented on code in PR #380:
URL: https://github.com/apache/arrow-ballista/pull/380#discussion_r999633316
##########
ballista/executor/src/execution_loop.rs:
##########
@@ -162,7 +165,7 @@ async fn run_received_tasks<T: 'static + AsLogicalPlan, U:
'static + AsExecution
task_id, job_id, stage_id, stage_attempt_num, partition_id,
task_attempt_num
);
info!("Received task {}", task_identity);
- available_tasks_slots.fetch_sub(1, Ordering::SeqCst);
+ let permit = available_task_slots.clone().acquire_owned().await.unwrap();
Review Comment:
Sorry about that, I didn't see the first check above. The problem I
described wouldn't happen.
Another option is to pass the permit from the first check into
`run_received_tasks()`, and then you wouldn't need this check. I think you
would replace the `available_task_slots` argument with an
[OwnedSemaphorePermit](https://docs.rs/tokio/latest/tokio/sync/struct.OwnedSemaphorePermit.html).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]