"lib/bindings/python/vscode:/vscode.git/clone" did not exist on "3f09c3955972ef443935eca7ffad3c7d29295cec"
Unverified Commit ffb54096 authored by Yan Ru Pei's avatar Yan Ru Pei Committed by GitHub
Browse files

fix: endpoint changes should be prioritized over new requests in kv scheduler (#2071)


Signed-off-by: default avatarYan Ru Pei <yanrpei@gmail.com>
parent e0a51940
...@@ -142,24 +142,20 @@ impl KvScheduler { ...@@ -142,24 +142,20 @@ impl KvScheduler {
request = tokio::select! { request = tokio::select! {
biased; biased;
new_request = request_rx.recv() => {
match new_request {
Some(new_request) => {
tracing::trace!("received request to be scheduled");
new_request
},
None => {
tracing::trace!("scheduler shutdown");
break 'outer;
}
}
}
_ = endpoints_rx.changed() => { _ = endpoints_rx.changed() => {
endpoints = endpoints_rx.borrow_and_update().clone(); endpoints = endpoints_rx.borrow_and_update().clone();
pending_endpoint_update = Some(endpoints.worker_ids()); pending_endpoint_update = Some(endpoints.worker_ids());
continue 'outer; continue 'outer;
} }
maybe_new_request = request_rx.recv() => {
let Some(new_request) = maybe_new_request else {
tracing::warn!("scheduler shutdown");
break 'outer;
};
tracing::trace!("received request to be scheduled");
new_request
}
}; };
loop { loop {
...@@ -181,6 +177,7 @@ impl KvScheduler { ...@@ -181,6 +177,7 @@ impl KvScheduler {
request.respond(response); request.respond(response);
continue 'outer; continue 'outer;
} }
// TODO: this is not actually hooked up
Err(KvSchedulerError::AllWorkersBusy) => { Err(KvSchedulerError::AllWorkersBusy) => {
tracing::trace!("all workers busy; waiting for more capacity"); tracing::trace!("all workers busy; waiting for more capacity");
tokio::time::sleep(Duration::from_millis(5)).await; tokio::time::sleep(Duration::from_millis(5)).await;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment