diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index 8bc652acef..5ce09500ee 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -1689,8 +1689,24 @@ where let token_cloned = token.clone(); let result = handler(r, token).await; if token_cloned.is_cancelled() { - info!("Cancelled request finished"); + // dropguard has executed: we will never turn this result into response. + // + // at least temporarily do {:?} logging; these failures are rare enough but + // could hide difficult errors. + match &result { + Ok(response) => { + let status = response.status(); + info!(%status, "Cancelled request finished successfully") + } + Err(e) => error!("Cancelled request finished with an error: {e:?}"), + } } + // only logging for cancelled panicked request handlers is the tracing_panic_hook, + // which should suffice. + // + // there is still a chance to lose the result due to race between + // returning from here and the actual connection closing happening + // before outer task gets to execute. leaving that up for #5815. result } .in_current_span(),