You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/17 16:20:10 UTC
[GitHub] [arrow-ballista] Dandandan opened a new pull request, #378: Avoid calling scheduler when the executor cannot accept new tasks
Dandandan opened a new pull request, #378:
URL: https://github.com/apache/arrow-ballista/pull/378
# Which issue does this PR close?
<!--
We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
-->
Closes #377
# Rationale for this change
<!--
Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
-->
# What changes are included in this PR?
<!--
There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
-->
# Are there any user-facing changes?
<!--
If there are user-facing changes then we may require documentation to be updated before approving the PR.
-->
<!--
If there are any breaking changes to public APIs, please add the `api change` label.
-->
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] andygrove commented on a diff in pull request #378: Avoid calling scheduler when the executor cannot accept new tasks
Posted by GitBox <gi...@apache.org>.
andygrove commented on code in PR #378:
URL: https://github.com/apache/arrow-ballista/pull/378#discussion_r997397238
##########
ballista/executor/src/execution_loop.rs:
##########
@@ -63,20 +63,28 @@ pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
info!("Starting poll work loop with scheduler");
loop {
- let task_status: Vec<TaskStatus> =
- sample_tasks_status(&mut task_status_receiver).await;
-
// 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
+ if !can_accept_task {
+ tokio::time::sleep(Duration::from_millis(1)).await;
Review Comment:
Is there any reasoning behind picking `1 ms` versus any other value? Would it be less overhead to sleep for longer here, maybe `10 ms`? Should we make this configurable?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Dandandan commented on a diff in pull request #378: Avoid calling scheduler when the executor cannot accept new tasks
Posted by GitBox <gi...@apache.org>.
Dandandan commented on code in PR #378:
URL: https://github.com/apache/arrow-ballista/pull/378#discussion_r997405760
##########
ballista/executor/src/execution_loop.rs:
##########
@@ -63,20 +63,28 @@ pub async fn poll_loop<T: 'static + AsLogicalPlan, U: 'static + AsExecutionPlan>
info!("Starting poll work loop with scheduler");
loop {
- let task_status: Vec<TaskStatus> =
- sample_tasks_status(&mut task_status_receiver).await;
-
// 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
+ if !can_accept_task {
+ tokio::time::sleep(Duration::from_millis(1)).await;
Review Comment:
I think checking the value is really cheap (e.g. compared to grpc requests), so I did use the minimum to reduce the latency as much as possible when a job is running.
I wonder if we can use some lock or channel instead of this loop in the future to rewrite this without `sleep` 🤔 and use resources more efficiently...
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [arrow-ballista] Dandandan merged pull request #378: Avoid calling scheduler when the executor cannot accept new tasks
Posted by GitBox <gi...@apache.org>.
Dandandan merged PR #378:
URL: https://github.com/apache/arrow-ballista/pull/378
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org