diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/db/model/mod.rs | 2 | ||||
| -rw-r--r-- | src/hash.rs | 1 | ||||
| -rw-r--r-- | src/http/mod.rs | 7 | ||||
| -rw-r--r-- | src/pipeline/mod.rs | 1 | ||||
| -rw-r--r-- | src/sandbox/kata.rs | 1 | ||||
| -rw-r--r-- | src/sandbox/loopback.rs | 1 | ||||
| -rw-r--r-- | src/sandbox/mod.rs | 4 | ||||
| -rw-r--r-- | src/sandbox/remote.rs | 1 | ||||
| -rw-r--r-- | src/time.rs | 2 |
9 files changed, 10 insertions, 10 deletions
diff --git a/src/db/model/mod.rs b/src/db/model/mod.rs index ba97073..aef6a47 100644 --- a/src/db/model/mod.rs +++ b/src/db/model/mod.rs @@ -53,6 +53,8 @@ pub struct Identity { pub epoch: String, pub pkgver: String, pub pkgrel: String, + // Neither field is read by name anywhere: `hash` renders the whole struct with + // `canonical_json`, so both participate in the identity digest by being here. pub upstream_pins: Vec<UpstreamPin>, pub source_digests: Vec<SourceDigest>, } diff --git a/src/hash.rs b/src/hash.rs index 8a2d884..ff7f41f 100644 --- a/src/hash.rs +++ b/src/hash.rs @@ -82,6 +82,7 @@ mod tests { #[test] fn the_rendering_is_canonical_in_fact_not_in_name() { + // Read only through `canonical_json`, never by name: that is the point. #[derive(serde::Serialize)] struct Ab { alpha: String, diff --git a/src/http/mod.rs b/src/http/mod.rs index 8a00745..c95cd16 100644 --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -102,7 +102,6 @@ impl Res { /// feature-conditional visibility. mod server { pub struct Server { - pub handle: std::thread::JoinHandle<()>, pub addr: String, } } @@ -124,7 +123,9 @@ pub fn spawn(cfg: Config, db: Db) -> std::io::Result<Server> { let addr = server.server_addr().to_ip().map(|a| a.to_string()).unwrap_or_else(|| cfg.bind.clone()); let state = Arc::new(State { cfg, db }); eprintln!("aur-build listening on http://{addr}"); - let handle = std::thread::Builder::new() + // Detached on purpose: the accept loop owns the listener and runs until the + // process ends, and nothing joins it, so the handle would be stored unread. + std::thread::Builder::new() .name("http-accept".into()) .spawn(crate::time::inherit(move || { for request in server.incoming_requests() { @@ -139,7 +140,7 @@ pub fn spawn(cfg: Config, db: Db) -> std::io::Result<Server> { .ok(); } }))?; - Ok(Server { handle, addr }) + Ok(Server { addr }) } fn serve(state: Arc<State>, mut request: tiny_http::Request) -> std::io::Result<()> { diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index e14c7a8..e571d71 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -150,7 +150,6 @@ impl Ctx { profile: self.profile.clone(), task: self.build.id.clone(), ttl: Duration::from_secs(self.cfg.lease_secs.max(1) as u64), - disk_mb: self.cfg.min_free_disk_mb, }; self.backend.acquire(&spec) } diff --git a/src/sandbox/kata.rs b/src/sandbox/kata.rs index 84a79e4..a54110a 100644 --- a/src/sandbox/kata.rs +++ b/src/sandbox/kata.rs @@ -308,7 +308,6 @@ mod kata_backend { Ok(vec![SandboxInfo { id: format!("kata@{} via {}", self.addr, self.provisioner.name()), profile: self.cfg.build_profile.clone(), - warm: !self.pending.lock().unwrap().is_empty(), }]) } } diff --git a/src/sandbox/loopback.rs b/src/sandbox/loopback.rs index 9629206..fb5ba00 100644 --- a/src/sandbox/loopback.rs +++ b/src/sandbox/loopback.rs @@ -53,7 +53,6 @@ impl SandboxBackend for LoopbackBackend { Ok(vec![SandboxInfo { id: "loopback".into(), profile: self.cfg.build_profile.clone(), - warm: true, }]) } } diff --git a/src/sandbox/mod.rs b/src/sandbox/mod.rs index ded76f0..b82647b 100644 --- a/src/sandbox/mod.rs +++ b/src/sandbox/mod.rs @@ -64,12 +64,11 @@ pub struct SandboxSpec { pub profile: String, pub task: String, pub ttl: Duration, - pub disk_mb: u64, } impl SandboxSpec { pub fn new(profile: impl Into<String>, task: impl Into<String>, ttl: Duration) -> Self { - Self { profile: profile.into(), task: task.into(), ttl, disk_mb: 0 } + Self { profile: profile.into(), task: task.into(), ttl } } } @@ -82,7 +81,6 @@ mod sandbox_info { pub struct SandboxInfo { pub id: String, pub profile: String, - pub warm: bool, } } diff --git a/src/sandbox/remote.rs b/src/sandbox/remote.rs index 6d369e2..8366e97 100644 --- a/src/sandbox/remote.rs +++ b/src/sandbox/remote.rs @@ -98,7 +98,6 @@ impl SandboxBackend for RemoteBackend { Ok(vec![SandboxInfo { id: format!("remote@{}", self.addr), profile: self.cfg.build_profile.clone(), - warm: !self.queue.is_empty(), }]) } } diff --git a/src/time.rs b/src/time.rs index 4f5ab7f..b0ab4ab 100644 --- a/src/time.rs +++ b/src/time.rs @@ -145,6 +145,8 @@ mod clock { // VirtualClock stays `pub`: lives in the `test-support`-gated clock module, behind the gated `virtualize()` that returns it. pub struct VirtualClock { + // Held, never read: owning the mutex *is* the virtual clock's lease, + // and dropping this guard is what releases it. _owner: MutexGuard<'static, ()>, } |
