@@ -76,6 +76,14 @@ use pingora_core::server::ShutdownWatch;
7676use pingora_core:: upstreams:: peer:: { HttpPeer , Peer } ;
7777use pingora_error:: { Error , ErrorSource , ErrorType :: * , OrErr , Result } ;
7878
79+ /// Synthetic 3xx used for redirect follow-up is control flow, not a proxy failure.
80+ fn is_benign_upstream_retry_log ( e : & Error ) -> bool {
81+ matches ! ( & e. etype, HTTPStatus ( code) if ( 300 ..400 ) . contains( code) )
82+ && e. context
83+ . as_ref ( )
84+ . is_some_and ( |c| c. as_str ( ) . starts_with ( "redirect_follow_hop:" ) )
85+ }
86+
7987const TASK_BUFFER_SIZE : usize = 4 ;
8088
8189mod proxy_cache;
@@ -977,13 +985,23 @@ where
977985 break ;
978986 }
979987 // only log error that will be retried here, the final error will be logged below
980- warn ! (
981- "Fail to proxy: {}, tries: {}, retry: {}, {}" ,
982- proxy_error. as_ref( ) . unwrap( ) ,
983- retries,
984- retry,
985- self . inner. request_summary( & session, & ctx)
986- ) ;
988+ if is_benign_upstream_retry_log ( proxy_error. as_ref ( ) . unwrap ( ) ) {
989+ debug ! (
990+ "Redirect follow: {}, tries: {}, retry: {}, {}" ,
991+ proxy_error. as_ref( ) . unwrap( ) ,
992+ retries,
993+ retry,
994+ self . inner. request_summary( & session, & ctx)
995+ ) ;
996+ } else {
997+ warn ! (
998+ "Fail to proxy: {}, tries: {}, retry: {}, {}" ,
999+ proxy_error. as_ref( ) . unwrap( ) ,
1000+ retries,
1001+ retry,
1002+ self . inner. request_summary( & session, & ctx)
1003+ ) ;
1004+ }
9871005 }
9881006 None => {
9891007 proxy_error = None ;
0 commit comments