Skip to content

Conversation

@Turnalek
Copy link
Contributor

@Turnalek Turnalek commented Sep 18, 2025

Summary & Motivation (Problem vs. Solution)

Expands the Manifest format and it's handling qos-client with pool-size and client-timeout parameters.

pool-size allows us to specify the number of internal USOCK/VSOCK connections for concurrency without impedeing app params list. It gets translated to an env var for the app.

client-timeout can now be used to specify the timeout for calls done by SocketClient inside the enclave.

There's also a minor refactor moving away from TimeVal to Duration in around SocketClient timeout type and params.

NOTE: hosts and proxy still need the timeout value handled explicitly of course, but that's out of scope for this PR.

WARNING: Please do NOT merge yet, as I want to test with a deploy in preprod first. Reviews are welcome.

How I Tested These Changes

Locally so far

@Turnalek Turnalek requested a review from a team as a code owner September 18, 2025 22:34
@Turnalek Turnalek requested review from emostov and r-n-o September 18, 2025 22:34
@emostov
Copy link
Contributor

emostov commented Sep 19, 2025

Generally looks good just a few comments

@Turnalek Turnalek requested a review from emostov September 23, 2025 16:47
@Turnalek Turnalek force-pushed the ales/async_pool_size branch from 6b3fe05 to 07173dd Compare September 23, 2025 17:15
@Turnalek Turnalek force-pushed the ales/async_pool_size branch from 07173dd to bff3355 Compare September 23, 2025 18:03
@Turnalek Turnalek requested a review from emostov September 23, 2025 22:39
Copy link
Contributor

@r-n-o r-n-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Some minor minor suggestions below (feel free to punt / address in a followup PR!); flawless diff otherwise 👑

Comment on lines 40 to +47
let enclave_pool =
StreamPool::new(SocketAddress::new_unix(&usock), 1).unwrap();
StreamPool::single(SocketAddress::new_unix(&usock)).unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Comment on lines 19 to 20
/// Initial client timeout for the processor until the Manifest says otherwise
pub const INITIAL_CLIENT_TIMEOUT: Duration = Duration::from_secs(5);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the "until the Manifest says otherwise" part? Maybe worth an extra bit of comment? (I think a simple "see reaper.rs" could be fine; that's where set_client_timeout is called from)

Comment on lines -210 to -234
fn get_pool_size_from_pivot_args(handles: &Handles) -> (bool, Option<u32>) {
if let Ok(envelope) = handles.get_manifest_envelope() {
(true, extract_pool_size_arg(&envelope.manifest.pivot.args))
} else {
(false, None)
}
}

// find the u32 value of --pool-size argument passed to the pivot if present
fn extract_pool_size_arg(args: &[String]) -> Option<u32> {
if let Some((i, _)) =
args.iter().enumerate().find(|(_, a)| *a == "--pool-size")
{
if let Some(pool_size_str) = args.get(i + 1) {
match pool_size_str.parse::<u32>() {
Ok(pool_size) => Some(pool_size),
Err(_) => None,
}
} else {
None
}
} else {
None
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@r-n-o r-n-o merged commit 9f30c71 into main Sep 24, 2025
8 checks passed
@r-n-o r-n-o deleted the ales/async_pool_size branch September 24, 2025 21:41
/// Sets the client timeout value for the `app_client`
/// Sets the client timeout value for the `app_client`, maximum allowed value is `u16::MAX` milliseconds
pub fn set_client_timeout(&mut self, timeout: Duration) {
assert!(timeout.as_millis() < u16::MAX.into(), "client timeout > 65s");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this will likely be too restrictive (e.g. zk proof gen). But we can cross that bridge when we get there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants