From 0f0606da3ca54970c5b700ab16f5bae625c8e258 Mon Sep 17 00:00:00 2001 From: John Spray Date: Fri, 8 Mar 2024 12:02:50 +0000 Subject: [PATCH] pageserver: fix api-5xx failpoints --- pageserver/src/http/routes.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pageserver/src/http/routes.rs b/pageserver/src/http/routes.rs index 9c4985b648..532f93c002 100644 --- a/pageserver/src/http/routes.rs +++ b/pageserver/src/http/routes.rs @@ -2103,9 +2103,15 @@ where R: std::future::Future, ApiError>> + Send + 'static, H: FnOnce(Request, CancellationToken) -> R + Send + Sync + 'static, { - fail::fail_point!("api-503", |_| Err(ApiError::ResourceUnavailable( - "failpoint".into() - ))); + if request.uri() != &"/v1/failpoints".parse::().unwrap() { + fail::fail_point!("api-503", |_| Err(ApiError::ResourceUnavailable( + "failpoint".into() + ))); + + fail::fail_point!("api-500", |_| Err(ApiError::InternalServerError( + anyhow::anyhow!("failpoint") + ))); + } // Spawn a new task to handle the request, to protect the handler from unexpected // async cancellations. Most pageserver functions are not async cancellation safe.