Closed neodes-h closed 4 months ago
same question
You may add tracing_subscriber for more logs.
See here, L164, you may check if get_http_session
returns Ok, or upstream_request_filter
will be called with no doubt when proxy_to_h1_upstream
or proxy_to_h2_upstream
;
try RUST_LOG=TRACE cargo run xxx
for more verbose logging.
"Entered upstream_request_filter" should be outputed in terminal 1.
It seems the proxy returned 502 which suggests that the connection to the origin might not be established in the place. The upstream_request_filter will only be called after the connection is established.
The request header in curl detail should be "Host: one.one.one.one"
Regardless of the issue above, the proxy won't change curl's output because the output just reflects what curl sends to the proxy.
@neodes-h : since it looks like your question has been answered, I'll close this issue out. Feel free to reopen if you still have questions on the topic.
If you read further in the quick start guide, you'll notice that we cover why you might be seeing a 502 occasionally with the round-robin LB (in the health checker section). As discussed above, if we fail to connect to the upstream, upstream_request_filter
won't be called. (You may be interested in adding more logging in the fail_to_connect
phase to confirm for yourself.)
upstream_request_filter not working
When I was trying to run the load-balancing example code in quickguide, it seems like the function
upstream_request_filter
is never executed.My code is:
When I run the code above in terminal 1 and send request using curl
curl -v 127.0.0.1:8080
in terminal 2, there is only one output for each requestThe curl output is
If I understand correctly, the expected behaviors should be:
Pingora info
Pingora version: 0.1.0 Rust version: cargo 1.78.0-nightly (194a60b29 2024-02-21) Operating system version: Pop!_OS 22.04 LTS
Steps to reproduce
Expected results
Observed results
Additional context
No