Compare commits

...

2 Commits

Author SHA1 Message Date
Charles Cunningham
3a3bdfece3 Remove app-server test RUST_MIN_STACK override 2026-02-18 21:52:18 -08:00
Charles Cunningham
ca6aeaef01 Increase Tokio worker stack to avoid detached review overflow 2026-02-18 19:29:23 -08:00
2 changed files with 7 additions and 11 deletions

View File

@@ -105,10 +105,6 @@ impl McpProcess {
cmd.stderr(Stdio::piped());
cmd.env("CODEX_HOME", codex_home);
cmd.env("RUST_LOG", "debug");
// Bazel/Linux workers can run with smaller default thread stacks, which makes
// tokio-runtime-worker stack overflows more likely in app-server integration tests.
// Pin a larger minimum stack for the spawned test server process.
cmd.env("RUST_MIN_STACK", "4194304");
cmd.env_remove(CODEX_INTERNAL_ORIGINATOR_OVERRIDE_ENV_VAR);
for (k, v) in env_overrides {

View File

@@ -13,7 +13,9 @@ const APPLY_PATCH_ARG0: &str = "apply_patch";
const MISSPELLED_APPLY_PATCH_ARG0: &str = "applypatch";
const LOCK_FILENAME: &str = ".lock";
#[cfg(target_os = "windows")]
const WINDOWS_TOKIO_WORKER_STACK_SIZE_BYTES: usize = 16 * 1024 * 1024;
const TOKIO_WORKER_STACK_SIZE_BYTES: usize = 16 * 1024 * 1024;
#[cfg(not(target_os = "windows"))]
const TOKIO_WORKER_STACK_SIZE_BYTES: usize = 4 * 1024 * 1024;
/// Keeps the per-session PATH entry alive and locked for the process lifetime.
pub struct Arg0PathEntryGuard {
@@ -129,12 +131,10 @@ where
fn build_runtime() -> anyhow::Result<tokio::runtime::Runtime> {
let mut builder = tokio::runtime::Builder::new_multi_thread();
builder.enable_all();
#[cfg(target_os = "windows")]
{
// Defensive hardening: Windows worker threads have lower effective
// stack headroom, so use a larger stack for runtime workers.
builder.thread_stack_size(WINDOWS_TOKIO_WORKER_STACK_SIZE_BYTES);
}
// Bazel/Linux workers commonly run with the default Tokio worker stack (2 MiB),
// which can overflow in deeper app-server startup paths (for example, detached review thread init).
// Pin a larger worker stack across platforms (Windows keeps the larger 16 MiB value).
builder.thread_stack_size(TOKIO_WORKER_STACK_SIZE_BYTES);
Ok(builder.build()?)
}