Skip to content

Conversation

Turnalek
Copy link
Contributor

@Turnalek Turnalek commented May 14, 2025

Summary & Motivation (Problem vs. Solution)

Implement async qos_net::AsyncProxy
this includes:
- Reaper::execute_async [qos_core]
- Stream [qos_core]
- AsyncPool/Stream [qos_core]
- Listener [qos_core]
- RequestProcessor [qos_core]
- ProxyConnection [qos_net]
- Proxy [qos_net]
- ProxyStream [qos_net]
- HostServer [qos_host]

as well as fixing qos_next's qos_core "vm" feature dependency issue by only requiring it if qos_net is requested with it, adding new integration tests and fixing qos_test_primitives shutdown handling on unix (SIGINT)

New dependencies:

How I Tested These Changes

Locally and in preprod.

Pre merge check list

  • Update CHANGELOG.MD

@Turnalek Turnalek force-pushed the ales/async_proxy branch 4 times, most recently from 85d5895 to 3667ab4 Compare May 15, 2025 20:56
@Turnalek Turnalek force-pushed the ales/async_proxy branch 10 times, most recently from 7aeca11 to 65672b2 Compare May 27, 2025 19:30
@Turnalek Turnalek force-pushed the ales/async_proxy branch 6 times, most recently from 6810191 to f4d01f0 Compare June 3, 2025 19:05
@Turnalek Turnalek marked this pull request as ready for review June 4, 2025 21:47
@Turnalek Turnalek requested review from a team as code owners June 4, 2025 21:47
@Turnalek Turnalek force-pushed the ales/async_proxy branch 5 times, most recently from f372272 to b55c07f Compare June 11, 2025 16:30

// allow clean exit
std::thread::sleep(Duration::from_millis(50));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised child.kill doesn't do this for us

What does the sleep do

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's just to ensure the drops are done on the running child. If we just SIGKILL the children won't cleanup.

test_only_init_phase_override,
);
SocketServer::listen(addr, processor).unwrap();
tokio::runtime::Builder::new_current_thread()
Copy link
Contributor

Choose a reason for hiding this comment

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

We talked about on our call - we will spawn this as a new task. And remove the std thread and new tokio runtime

Copy link
Contributor Author

@Turnalek Turnalek Sep 9, 2025

Choose a reason for hiding this comment

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

I think I'll do this on a follow up PR along with Reaper refactor.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the goal with adding this example? Shouldn't this be almost the same boot e2e test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's for local testing, so you can spin up a full local enclave that's properly booted and then feed it whatever. Makes it easier than having to write a specific test, it's also "live" so easier to debug.

);

// do a bunch of timing out requests at the same time, this still needs to fit within the pool size
for _ in 0..3 {
Copy link
Contributor

Choose a reason for hiding this comment

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

what would happen if we did more then the pool size (>5)

None,
);
// start reaper in a thread so we can terminate on ctrl+c properly
std::thread::spawn(move || {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can put this into a tokio task, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, once Reaper is refactored

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.

First read through! Overall no major concerns, the only "big" thing I'd like to push for is getting --pool-size out of the pivot args now rather than later. I think it'll be easier to do before this lands and gets deployed in mono. My other comments are all small stuff!

Comment on lines +215 to +231
// 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.

relates to my earlier comment about awkwardness of this being a pivot arg...let's make this a proper manifest field and this can go away! (I think it's worth it: it's easy enough to change now, but if this ships as-is I think the change becomes more daunting)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm mostly concerned with keeping this alive longer. If we do this change we have to retest the full stack again and keeping both this and the mono PRs up is becoming really hard due to all the related changes from main.

@Turnalek Turnalek marked this pull request as ready for review September 10, 2025 16:39
}

/// Expands the underlaying `AsyncPool` to given `pool_size`
Copy link
Contributor

Choose a reason for hiding this comment

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

(typo) underlying

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.

Some followups left to address but I think this PR is in a great spot already! It'll be easier to review and address the rest in separate, smaller PRs. Let's get you out of rebase hell! 🚀

@r-n-o r-n-o merged commit ed53e65 into main Sep 11, 2025
8 checks passed
@r-n-o r-n-o deleted the ales/async_proxy branch September 11, 2025 22:46
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