ssl: pass test_ssl with the rustls backend - #8502
Conversation
Assisted-by: OpenAI Codex:GPT-5
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR updates AWS-LC rustls compatibility metadata and SNI error reporting, improves certificate and handshake signature verification, and sets an 8 MiB default stack for debug Python threads with Linux and macOS tests. ChangesSSL behavior updates
Debug thread stack sizing
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
crates/vm/src/stdlib/_thread.rs (1)
2034-2047: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winCover the explicit stack-size path.
The test only covers
vm.state.stacksize == 0. Add a debug Linux/macOS test that sets a value larger thanDEFAULT_THREAD_STACK_SIZEand verifies that the observed native stack size is at least that configured value. This verifies that an explicitthreading.stack_size()value continues to override the debug default.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/vm/src/stdlib/_thread.rs` around lines 2034 - 2047, Add a debug Linux/macOS test alongside default_python_thread_stack_size_debug that sets vm.state.stacksize to a value larger than DEFAULT_THREAD_STACK_SIZE before calling apply_thread_stack_size, then spawn and join current_thread_stack_size and assert the observed size is at least the configured value. Keep the test scoped to the supported debug platforms and verify the explicit stack-size setting overrides the default.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@crates/vm/src/stdlib/_thread.rs`:
- Around line 2034-2047: Add a debug Linux/macOS test alongside
default_python_thread_stack_size_debug that sets vm.state.stacksize to a value
larger than DEFAULT_THREAD_STACK_SIZE before calling apply_thread_stack_size,
then spawn and join current_thread_stack_size and assert the observed size is at
least the configured value. Keep the test scoped to the supported debug
platforms and verify the explicit stack-size setting overrides the default.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro Plus
Run ID: b11c80dd-21cb-4f69-a121-1691a32525ec
📒 Files selected for processing (3)
crates/stdlib/src/ssl.rscrates/stdlib/src/ssl/cert.rscrates/vm/src/stdlib/_thread.rs
Assisted-by: OpenAI Codex:GPT-5
Summary
test_sslbehaviorRoot cause
Several rustls compatibility details diverged from the behavior expected by CPython's SSL tests. In addition, Rust's 2 MiB default worker-thread stack is too small for RustPython's unoptimized debug call chains: the threaded SSL server reached the native stack guard at a Python recursion depth of only 21. The stack override is debug-only, preserves explicit
threading.stack_size()values, and leaves release behavior unchanged.Impact
cargo run -- -m test test_sslnow completes successfully with all 196 enabled tests passing. The changes keep the non-OpenSSL rustls/AWS-LC implementation and improve handshake correctness and certificate compatibility.Validation
cargo run -- -m test test_sslcargo run --release -- -m test test_ssl test_threadcargo test -p rustpython-vm --features threading default_python_thread_stack_size_debug -- --nocapturecargo test --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi(cd crates/capi && cargo test)cargo fmt --all -- --checkcargo clippy --workspace --exclude rustpython_wasm --exclude rustpython-venvlauncher --exclude rustpython-capi --all-targetsThe clippy run completed with only five pre-existing
must_use_candidatewarnings inrustpython-compiler-source.Summary by CodeRabbit