🚀 release: 2.0.8 final — multi-thread server (ADR-085), free-threaded support (ADR-084), async handler fix (ADR-083)
swadhinbiswas committed 2 months ago
f5b3f46
1 parent 83f282e
commit f5b3f46
3 files changed
+10 -4
Showing 3 changed files+10-4
â–¼crates/justapi-core/src/router.rs
+2-1
| @@ -405,7 +405,8 @@ mod tests { | ||
405 | 405 | println!("500-route table: {} lookups, avg {}ns", total_lookups, avg_ns,); |
406 | 406 | |
407 | 407 | // Benchmark gate: average lookup should be under 2us (release) / 5us (debug) |
408 | - // Skip threshold check in Miri interpreter mode | |
408 | + // Skip threshold check in Miri interpreter mode (sanitizer runs filter | |
409 | + // bench tests out via scripts/sanitize.sh — see below). | |
409 | 410 | if !cfg!(miri) { |
410 | 411 | let target = if cfg!(debug_assertions) { 5000 } else { 2000 }; |
411 | 412 | assert!(avg_ns < target, "Route lookup too slow: {}ns (target < {}ns)", avg_ns, target); |
412 | 413 | |
â–¼crates/justapi-py/src/gil_pool.rs
+3-2
| @@ -100,13 +100,14 @@ fn default_pool_size(mode: RuntimeMode) -> usize { | ||
100 | 100 | /// `sys._is_gil_enabled` read is NOT reliable through pyo3's import on |
101 | 101 | /// free-threaded interpreters (reads true), so it is only a fallback for |
102 | 102 | /// builds where the cfg is unavailable. |
103 | -fn detect_mode(py: Python<'_>) -> RuntimeMode { | |
103 | +fn detect_mode(_py: Python<'_>) -> RuntimeMode { | |
104 | 104 | #[cfg(Py_GIL_DISABLED)] |
105 | 105 | { |
106 | - return RuntimeMode::GilFree; | |
106 | + RuntimeMode::GilFree | |
107 | 107 | } |
108 | 108 | #[cfg(not(Py_GIL_DISABLED))] |
109 | 109 | { |
110 | + let py = _py; | |
110 | 111 | let gil_enabled = py |
111 | 112 | .import("sys") |
112 | 113 | .ok() |
113 | 114 | |
â–¼scripts/sanitize.sh
+5-1
| @@ -49,12 +49,16 @@ run_step() { | ||
49 | 49 | } |
50 | 50 | |
51 | 51 | if [[ "$MODE" == "all" || "$MODE" == "--asan" ]]; then |
52 | + # Exclude benchmark-gate tests: they assert on wall-clock timing and fail | |
53 | + # under sanitizer instrumentation (~2x slowdown). Benchmarks are for | |
54 | + # release builds; sanitizers are for memory safety. | |
52 | 55 | run_step "AddressSanitizer on justapi-core (lib, features=db)" "$ASAN_LOG" \ |
53 | 56 | env PATH="$HOME/.cargo/bin:$PATH" \ |
54 | 57 | CARGO_TARGET_DIR="$ASAN_TARGET_DIR" \ |
55 | 58 | RUSTFLAGS="-Zsanitizer=address" \ |
56 | 59 | rustup run nightly cargo test -p justapi-core --lib --features db \ |
57 | - -Zbuild-std --target x86_64-unknown-linux-gnu | |
60 | + -Zbuild-std --target x86_64-unknown-linux-gnu \ | |
61 | + -- --skip bench_ | |
58 | 62 | fi |
59 | 63 | |
60 | 64 | if [[ "$MODE" == "all" || "$MODE" == "--miri" ]]; then |
61 | 65 | |