Skip to content

Commit 97331e5

Browse files
authored
Merge pull request #1123 from rust-lang/cache-rework
2 parents 73f90a9 + f116c28 commit 97331e5

File tree

6 files changed

+394
-342
lines changed

6 files changed

+394
-342
lines changed

compiler/base/orchestrator/src/coordinator.rs

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,7 @@ impl Container {
18311831
already_cancelled = true;
18321832

18331833
let msg = CoordinatorMessage::Kill;
1834-
trace!("processing {msg:?}");
1834+
trace!(msg_name = msg.as_ref(), "processing");
18351835
to_worker_tx.send(msg).await.context(KillSnafu)?;
18361836
},
18371837

@@ -1847,12 +1847,12 @@ impl Container {
18471847
}
18481848
};
18491849

1850-
trace!("processing {msg:?}");
1850+
trace!(msg_name = msg.as_ref(), "processing");
18511851
to_worker_tx.send(msg).await.context(StdinSnafu)?;
18521852
},
18531853

18541854
Some(container_msg) = from_worker_rx.recv() => {
1855-
trace!("processing {container_msg:?}");
1855+
trace!(msg_name = container_msg.as_ref(), "processing");
18561856

18571857
match container_msg {
18581858
WorkerMessage::ExecuteCommand(resp) => {
@@ -2358,48 +2358,63 @@ impl Commander {
23582358
gc_interval.set_missed_tick_behavior(MissedTickBehavior::Delay);
23592359

23602360
loop {
2361-
select! {
2362-
command = command_rx.recv() => {
2363-
let Some((ack_tx, command)) = command else { break };
2361+
enum Event {
2362+
Command(Option<(oneshot::Sender<()>, DemultiplexCommand)>),
23642363

2364+
FromWorker(Option<Multiplexed<WorkerMessage>>),
2365+
2366+
// Find any channels where the receivers have been
2367+
// dropped and clear out the sending halves.
2368+
Gc,
2369+
}
2370+
use Event::*;
2371+
2372+
let event = select! {
2373+
command = command_rx.recv() => Command(command),
2374+
2375+
msg = from_worker_rx.recv() => FromWorker(msg),
2376+
2377+
_ = gc_interval.tick() => Gc,
2378+
};
2379+
2380+
match event {
2381+
Command(None) => break,
2382+
Command(Some((ack_tx, command))) => {
23652383
match command {
23662384
DemultiplexCommand::Listen(job_id, waiter) => {
2367-
trace!("adding listener for {job_id:?}");
2385+
trace!(job_id, "adding listener (many)");
23682386
let old = waiting.insert(job_id, waiter);
23692387
ensure!(old.is_none(), DuplicateDemultiplexerClientSnafu { job_id });
23702388
}
23712389

23722390
DemultiplexCommand::ListenOnce(job_id, waiter) => {
2373-
trace!("adding listener for {job_id:?}");
2391+
trace!(job_id, "adding listener (once)");
23742392
let old = waiting_once.insert(job_id, waiter);
23752393
ensure!(old.is_none(), DuplicateDemultiplexerClientSnafu { job_id });
23762394
}
23772395
}
23782396

23792397
ack_tx.send(()).ok(/* Don't care about it */);
2380-
},
2381-
2382-
msg = from_worker_rx.recv() => {
2383-
let Some(Multiplexed(job_id, msg)) = msg else { break };
2398+
}
23842399

2400+
FromWorker(None) => break,
2401+
FromWorker(Some(Multiplexed(job_id, msg))) => {
23852402
if let Some(waiter) = waiting_once.remove(&job_id) {
2386-
trace!("notifying listener for {job_id:?}");
2403+
trace!(job_id, "notifying listener (once)");
23872404
waiter.send(msg).ok(/* Don't care about it */);
23882405
continue;
23892406
}
23902407

23912408
if let Some(waiter) = waiting.get(&job_id) {
2392-
trace!("notifying listener for {job_id:?}");
2409+
trace!(job_id, "notifying listener (many)");
23932410
waiter.send(msg).await.ok(/* Don't care about it */);
23942411
continue;
23952412
}
23962413

2397-
warn!("no listener for {job_id:?}");
2414+
warn!(job_id, "no listener to notify");
23982415
}
23992416

2400-
// Find any channels where the receivers have been
2401-
// dropped and clear out the sending halves.
2402-
_ = gc_interval.tick() => {
2417+
Gc => {
24032418
waiting = mem::take(&mut waiting)
24042419
.into_iter()
24052420
.filter(|(_job_id, tx)| !tx.is_closed())

compiler/base/orchestrator/src/message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ macro_rules! impl_narrow_to_broad {
2222
#[derive(Debug, Serialize, Deserialize)]
2323
pub struct Multiplexed<T>(pub JobId, pub T);
2424

25-
#[derive(Debug, Serialize, Deserialize)]
25+
#[derive(Debug, Serialize, Deserialize, strum_macros::AsRefStr)]
2626
pub enum CoordinatorMessage {
2727
WriteFile(WriteFileRequest),
2828
DeleteFile(DeleteFileRequest),

tests/spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
capture_js_log = ENV.fetch('CAPTURE_JS_LOG', 'false').casecmp?('true')
4040
Selenium::WebDriver.logger.level = :debug if capture_js_log
41+
Selenium::WebDriver.logger.ignore(:clear_local_storage, :clear_session_storage)
4142

4243
browser_options = ::Selenium::WebDriver::Firefox::Options.new
4344
browser_options.add_argument('-headless') if ENV.fetch('HEADLESS', 'true').casecmp?('true')

ui/src/metrics.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,6 @@ pub(crate) enum Endpoint {
8686
MacroExpansion,
8787
MetaCrates,
8888
MetaVersions,
89-
MetaVersionStable,
90-
MetaVersionBeta,
91-
MetaVersionNightly,
92-
MetaVersionRustfmt,
93-
MetaVersionClippy,
94-
MetaVersionMiri,
9589
Evaluate,
9690
}
9791

0 commit comments

Comments
 (0)