From 93c3a2976a8746a8851d84f9bc7314b077422c08 Mon Sep 17 00:00:00 2001 From: hukla <129692708+huklaa@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:17:09 +0300 Subject: [PATCH 1/4] fix(quake): skip latency emulation on WSL2 --- crates/quake/src/latency.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/quake/src/latency.rs b/crates/quake/src/latency.rs index 5daa63e2..e81bb362 100644 --- a/crates/quake/src/latency.rs +++ b/crates/quake/src/latency.rs @@ -172,6 +172,13 @@ fn generate_tc_script( script.push_str("set -e\n\n"); + // WSL2's kernel does not provide the qdisc modules used by tc/netem in this setup. + // Skip latency emulation there so localdev can still start without manual script edits. + script.push_str("if grep -qi microsoft /proc/sys/kernel/osrelease 2>/dev/null; then\n"); + script.push_str(" echo \"WSL2 detected; skipping latency emulation because required tc qdisc modules are unavailable.\"\n"); + script.push_str(" exit 0\n"); + script.push_str("fi\n\n"); + // Install iproute2 and iptables if ip or tc commands are missing (e.g. release images) script.push_str("if [ -f /etc/debian_version ] && ! which ip tc > /dev/null; then\n"); script.push_str(" (apt-get update -qq && apt-get install -y -qq --no-install-recommends iproute2 iptables) >/dev/null 2>&1\n"); @@ -407,4 +414,4 @@ fn assign_regions( } Ok(node_regions) -} +} \ No newline at end of file From bfc0bfabe16617992aa9676be8e22ec0132aecbb Mon Sep 17 00:00:00 2001 From: hukla <129692708+huklaa@users.noreply.github.com> Date: Fri, 21 Aug 2026 17:38:27 +0300 Subject: [PATCH 2/4] add trailing newline --- crates/quake/src/latency.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/quake/src/latency.rs b/crates/quake/src/latency.rs index e81bb362..deca2c41 100644 --- a/crates/quake/src/latency.rs +++ b/crates/quake/src/latency.rs @@ -412,6 +412,7 @@ fn assign_regions( node_regions.insert(name.clone(), region); } } + Ok(node_regions) -} \ No newline at end of file +} From 245cbaf5c0fa040ab2089a458b07f2fdfeba97e3 Mon Sep 17 00:00:00 2001 From: hukla <129692708+huklaa@users.noreply.github.com> Date: Sat, 22 Aug 2026 01:48:34 +0300 Subject: [PATCH 3/4] fix(quake): tighten WSL2 detection and formatting --- crates/quake/src/latency.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/quake/src/latency.rs b/crates/quake/src/latency.rs index deca2c41..2388fdf3 100644 --- a/crates/quake/src/latency.rs +++ b/crates/quake/src/latency.rs @@ -53,7 +53,7 @@ pub enum Region { #[serde(rename = "ap-southeast-1")] #[strum(serialize = "ap-southeast-1")] ApSoutheast1 = 3, - /// Sydney, Australia + /// Sydney #[serde(rename = "ap-southeast-2")] #[strum(serialize = "ap-southeast-2")] ApSoutheast2 = 4, @@ -149,7 +149,7 @@ pub(crate) const AWS_LATENCY_MATRIX: [[u32; 14]; 14] = [ /*us-e-1 */ [ 76, 93, 95, 109, 101, 10, 48, 36, 40, 58, 0, 10, 35, 34], // us-east-1 (N. Virginia) /*us-e-2 */ [ 70, 86, 100, 103, 94, 15, 52, 41, 45, 63, 10, 0, 29, 27], // us-east-2 (Ohio) /*us-w-1 */ [ 56, 70, 118, 88, 70, 41, 78, 67, 75, 88, 35, 29, 0, 12], // us-west-1 (N. California) -/*us-w-2 */ [ 51, 65, 112, 83, 71, 32, 73, 61, 66, 89, 34, 27, 12, 0], // us-west-2 (Oregon) +/*us-w-2*/ [ 51, 65, 112, 83, 71, 32, 73, 61, 66, 89, 34, 27, 12, 0], // us-west-2 (Oregon) ]; /// Generate bash script content for network latency emulation using tc @@ -174,7 +174,7 @@ fn generate_tc_script( // WSL2's kernel does not provide the qdisc modules used by tc/netem in this setup. // Skip latency emulation there so localdev can still start without manual script edits. - script.push_str("if grep -qi microsoft /proc/sys/kernel/osrelease 2>/dev/null; then\n"); + script.push_str("if grep -qi microsoft-standard /proc/sys/kernel/osrelease 2>/dev/null; then\n"); script.push_str(" echo \"WSL2 detected; skipping latency emulation because required tc qdisc modules are unavailable.\"\n"); script.push_str(" exit 0\n"); script.push_str("fi\n\n"); @@ -412,7 +412,6 @@ fn assign_regions( node_regions.insert(name.clone(), region); } } - Ok(node_regions) } From bcc00b9ab9e3ec3cabcc51f9528d0838001f6585 Mon Sep 17 00:00:00 2001 From: hukla <129692708+huklaa@users.noreply.github.com> Date: Sat, 22 Aug 2026 01:49:34 +0300 Subject: [PATCH 4/4] chore(quake): restore unrelated formatting --- crates/quake/src/latency.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/quake/src/latency.rs b/crates/quake/src/latency.rs index 2388fdf3..bac03a03 100644 --- a/crates/quake/src/latency.rs +++ b/crates/quake/src/latency.rs @@ -53,7 +53,7 @@ pub enum Region { #[serde(rename = "ap-southeast-1")] #[strum(serialize = "ap-southeast-1")] ApSoutheast1 = 3, - /// Sydney + /// Sydney, Australia #[serde(rename = "ap-southeast-2")] #[strum(serialize = "ap-southeast-2")] ApSoutheast2 = 4, @@ -149,7 +149,7 @@ pub(crate) const AWS_LATENCY_MATRIX: [[u32; 14]; 14] = [ /*us-e-1 */ [ 76, 93, 95, 109, 101, 10, 48, 36, 40, 58, 0, 10, 35, 34], // us-east-1 (N. Virginia) /*us-e-2 */ [ 70, 86, 100, 103, 94, 15, 52, 41, 45, 63, 10, 0, 29, 27], // us-east-2 (Ohio) /*us-w-1 */ [ 56, 70, 118, 88, 70, 41, 78, 67, 75, 88, 35, 29, 0, 12], // us-west-1 (N. California) -/*us-w-2*/ [ 51, 65, 112, 83, 71, 32, 73, 61, 66, 89, 34, 27, 12, 0], // us-west-2 (Oregon) +/*us-w-2 */ [ 51, 65, 112, 83, 71, 32, 73, 61, 66, 89, 34, 27, 12, 0], // us-west-2 (Oregon) ]; /// Generate bash script content for network latency emulation using tc