From 3c8896a05166ed4f2fbf35345011c09c4ae27a7a Mon Sep 17 00:00:00 2001 From: Bugen Zhao Date: Thu, 22 Feb 2024 16:55:29 +0800 Subject: [PATCH] fix rest Signed-off-by: Bugen Zhao --- src/frontend/planner_test/src/lib.rs | 2 +- src/meta/src/dashboard/mod.rs | 3 ++- src/meta/src/manager/sink_coordination/coordinator_worker.rs | 2 +- .../tests/integration_tests/recovery/background_ddl.rs | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/frontend/planner_test/src/lib.rs b/src/frontend/planner_test/src/lib.rs index f7ce8cc04a950..1578fa5cd0dfe 100644 --- a/src/frontend/planner_test/src/lib.rs +++ b/src/frontend/planner_test/src/lib.rs @@ -944,7 +944,7 @@ pub async fn run_test_file(file_path: &Path, file_content: &str) -> Result<()> { "Test #{i} (id: {}) failed, SQL:\n{}\nError: {}", c.id().clone().unwrap_or_else(|| "".to_string()), c.sql(), - e + e.as_report() ); failed_num += 1; } diff --git a/src/meta/src/dashboard/mod.rs b/src/meta/src/dashboard/mod.rs index 814e14d42af9e..b5104e557a1b2 100644 --- a/src/meta/src/dashboard/mod.rs +++ b/src/meta/src/dashboard/mod.rs @@ -30,6 +30,7 @@ use axum::Router; use hyper::Request; use parking_lot::Mutex; use risingwave_rpc_client::ComputeClientPool; +use thiserror_ext::AsReport; use tower::{ServiceBuilder, ServiceExt}; use tower_http::add_extension::AddExtensionLayer; use tower_http::cors::{self, CorsLayer}; @@ -455,7 +456,7 @@ impl DashboardService { proxy::proxy(req, cache).await.or_else(|err| { Ok(( StatusCode::INTERNAL_SERVER_ERROR, - format!("Unhandled internal error: {}", err), + err.context("Unhandled internal error").to_report_string(), ) .into_response()) }) diff --git a/src/meta/src/manager/sink_coordination/coordinator_worker.rs b/src/meta/src/manager/sink_coordination/coordinator_worker.rs index bebef2d307dcc..e1c096aa3cf98 100644 --- a/src/meta/src/manager/sink_coordination/coordinator_worker.rs +++ b/src/meta/src/manager/sink_coordination/coordinator_worker.rs @@ -110,7 +110,7 @@ impl CoordinatorWorker { .wait_for_writers(first_writer_request.vnode_bitmap) .await { - error!("failed to wait for all writers: {:?}", e); + error!(error = %e.as_report(), "failed to wait for all writers"); worker .send_to_all_sink_writers(|| { Err(Status::cancelled("failed to wait for all writers")) diff --git a/src/tests/simulation/tests/integration_tests/recovery/background_ddl.rs b/src/tests/simulation/tests/integration_tests/recovery/background_ddl.rs index 97c08d098f6c9..27cf4985dc4fd 100644 --- a/src/tests/simulation/tests/integration_tests/recovery/background_ddl.rs +++ b/src/tests/simulation/tests/integration_tests/recovery/background_ddl.rs @@ -15,6 +15,7 @@ use std::time::Duration; use anyhow::{anyhow, Result}; +use risingwave_common::error::v2::AsReport; use risingwave_simulation::cluster::{Cluster, Configuration, Session}; use tokio::time::sleep; @@ -348,7 +349,7 @@ async fn test_high_barrier_latency_cancel(config: Configuration) -> Result<()> { .run("CREATE MATERIALIZED VIEW mv1 as values(1)") .await { - tracing::info!("Recreate mv failed with {e:?}"); + tracing::info!(error = %e.as_report(), "Recreate mv failed"); continue; } else { tracing::info!("recreated mv");