-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enabling HTTP2 crashes at runtime on client #287
Comments
It crashes in hyper, ostensibly from a lack of setting up a timer. I don't think this has anything to do with hyper-rustls. |
It's interesting, same thing with reqwest, but the runtime does indeed have a timer available. |
It seems to me that there is something going on here around the new hyper 1.x runtime expecting to find a tokio timer, but not seeing it due to something?
It is, however, enabled
and the feature flag present. |
Do you have the http2 feature set on hyper-util? That is what hooks up its |
I do, yes, it does seem like there was the same traceback server side on sleep as well as the client. |
I wonder if criterion messes with the timer in some unexpected way. |
// Configure the builder
let mut builder = builder.clone();
builder
// HTTP/1 settings
.http1()
// Enable half-close for better connection handling
.half_close(true)
// Enable keep-alive to reduce overhead for multiple requests
.keep_alive(true)
// Increase max buffer size to 256KB for better performance with larger payloads
.max_buf_size(256 * 1024)
// Enable immediate flushing of pipelined responses
.pipeline_flush(true)
// Preserve original header case for compatibility
.preserve_header_case(true)
// Disable automatic title casing of headers to reduce processing overhead
.title_case_headers(false)
// HTTP/2 settings
.http2()
// Add the timer to the builder
// This will cause you all sorts of pain otherwise
// https://github.com/seanmonstar/reqwest/issues/2421
// https://github.com/rustls/hyper-rustls/issues/287
.timer(TokioTimer::new())
// Increase initial stream window size to 2MB for better throughput
.initial_stream_window_size(Some(2 * 1024 * 1024))
// Increase initial connection window size to 4MB for improved performance
.initial_connection_window_size(Some(4 * 1024 * 1024))
// Enable adaptive window for dynamic flow control
.adaptive_window(true)
// Increase max frame size to 32KB for larger data chunks
.max_frame_size(Some(32 * 1024))
// Allow up to 2000 concurrent streams for better parallelism
.max_concurrent_streams(Some(2000))
// Increase max send buffer size to 2MB for improved write performance
.max_send_buf_size(2 * 1024 * 1024)
// Enable CONNECT protocol support for proxying and tunneling
.enable_connect_protocol()
// Increase max header list size to 32KB to handle larger headers
.max_header_list_size(32 * 1024)
// Set keep-alive interval to 10 seconds for more responsive connection management
.keep_alive_interval(Some(Duration::from_secs(10)))
// Set keep-alive timeout to 30 seconds to balance connection reuse and resource conservation
.keep_alive_timeout(Duration::from_secs(30)); This ended up being a |
Working on some benchmarks for a new server.
Unable to use the http2 client.
at runtime, when I enable:
http1 works just fine.
Whole file:
https://github.com/warlock-labs/hyper-server/blob/ff7b4397fa1a0488dd5534fc46c27d21248bd5d7/benches/hello_world_tower_hyper_tls_tcp.rs
The text was updated successfully, but these errors were encountered: