Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e116f0c
fix(daemon): reclaim control slots after retained connection failure …
mengmengmengqiang Nov 4, 2026
7cfe446
fix(daemon): complete slot-class isolation and capacity notice (#540)
mengmengmengqiang Nov 4, 2026
52f9c16
fix(control): bound sandbox.get's capacity query to 2s (#540)
mengmengmengqiang Nov 4, 2026
c9457e3
feat(control): query live daemon capacity in doctor (#540)
mengmengmengqiang Nov 4, 2026
31375c9
fix(control,daemon): move tests out of product source and type the ca…
mengmengmengqiang Nov 4, 2026
20d0d48
test: repair two stale fixtures that fail on a pristine v2.0.0 tree (…
mengmengmengqiang Nov 4, 2026
38a7cac
docs(540): add architecture and recovery diagrams (#540)
mengmengmengqiang Nov 4, 2026
4dbbcb7
docs(540): use final recovery-sequence diagram (#540)
mengmengmengqiang Nov 4, 2026
82165e6
Merge layerfs_v2_0_0 into fix/540-daemon-slots (resolve #543 conflicts)
mengmengmengqiang Nov 9, 2026
cf366d7
fix(daemon): cover the new MountNamed request in the retained-record …
mengmengmengqiang Nov 9, 2026
aca50df
test: keep the base's already-fixed fixtures exactly (#543)
mengmengmengqiang Nov 9, 2026
403c70e
fix(home): widen statvfs blocks through u128 to avoid a Linux-only us…
mengmengmengqiang Nov 9, 2026
d788cc0
test(doctor): silence the macOS-only native binding on Linux (#543)
mengmengmengqiang Nov 9, 2026
5002922
feat(sandbox): expose the daemon's control capacity in sandbox.get (#…
jiangkoumo Nov 11, 2026
8978c2e
test(sandbox): cover the capacity notice a full pool's next client re…
jiangkoumo Nov 11, 2026
88c88fb
fix(sandbox): restore the daemon capacity read in sandbox.get (#543)
jiangkoumo Nov 11, 2026
811f59e
test(sandbox): cover the capacity read's routes, wall and pool slot (…
jiangkoumo Nov 11, 2026
de009a8
docs(sandbox): cite #540 plainly in sandbox.get's field table (#543)
jiangkoumo Nov 11, 2026
49e5403
fix(sandbox): keep a fenced control connection out of the pool (#543)
jiangkoumo Nov 11, 2026
4f4906a
Merge pull request #68 from jiangkoumo/fix/543-gaps
mengmengmengqiang Nov 11, 2026
37cc771
Merge upstream layerfs_v2_0_0 (bdeb9e91f, #639/#641/#621) into fix/54…
mengmengmengqiang Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions api/crates/layerfs-api/src/sandbox/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::calls::Context;
use layerfs_bridge::control::SdkValue;
use layerfs_home::home::with_field;
use layerfs_home::outcome::{Outcome, View};
use layerfs_sandbox::family::{get, GetRequest, Page};
use layerfs_sandbox::family::{get, GetRequest, Got, Page};

/// Its table entry.
pub(crate) const CALL: Call = call(
Expand All @@ -17,9 +17,11 @@ pub(crate) const CALL: Call = call(
run,
);

/// Runs `sandbox.get`: its record with its derived `state`, one page of
/// its `workspaces` (each with its `path`, `name` and `ws`), why its
/// machine did not answer (`down_reason`) and `next_page_pos`.
/// Runs `sandbox.get`: its record with its derived `state`, one page of its
/// `workspaces` (each with its `path`, `name` and `ws`), why its machine did
/// not answer (`down_reason`), the daemon's `daemon_capacity` read model when
/// the Sandbox answered it (#540), and `next_page_pos`. The library reads it
/// best effort and bounded, so this layer only shows what it got.
fn run(context: &mut Context<'_>, args: &SdkValue) -> Outcome {
let request = GetRequest {
name: args.get_text("name").unwrap_or("").to_owned(),
Expand All @@ -29,18 +31,28 @@ fn run(context: &mut Context<'_>, args: &SdkValue) -> Outcome {
},
};
let (home, events) = context.parts();
let got = get(home, events, &request)?;
let workspaces = got.workspaces.into_iter().map(|listed| {
let Got {
record,
state,
workspaces,
down_reason,
next,
daemon_capacity,
} = get(home, events, &request)?;
let workspaces = workspaces.into_iter().map(|listed| {
let item = with_field(listed.item, "path", SdkValue::Text(listed.path));
let item = with_field(item, "name", SdkValue::opt_text(listed.name));
with_field(item, "ws", SdkValue::Text(listed.ws))
});
let shown = got.record.to_sdk(View::Full);
let shown = with_field(shown, "state", SdkValue::text(got.state));
let shown = record.to_sdk(View::Full);
let shown = with_field(shown, "state", SdkValue::text(state));
let mut shown = with_field(shown, "workspaces", SdkValue::List(workspaces.collect()));
if let Some(why) = got.down_reason {
if let Some(why) = down_reason {
shown = with_field(shown, "down_reason", SdkValue::Text(why));
}
let next = super::list::next_page_pos(got.next);
if let Some(model) = daemon_capacity {
shown = with_field(shown, "daemon_capacity", model.to_sdk());
}
let next = super::list::next_page_pos(next);
Ok(with_field(shown, "next_page_pos", next))
}
Loading