diff --git a/src/expr/core/src/expr/wrapper/non_strict.rs b/src/expr/core/src/expr/wrapper/non_strict.rs index f28e74eed14e2..fa261cfabe446 100644 --- a/src/expr/core/src/expr/wrapper/non_strict.rs +++ b/src/expr/core/src/expr/wrapper/non_strict.rs @@ -12,9 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::sync::LazyLock; + use async_trait::async_trait; use auto_impl::auto_impl; use risingwave_common::array::{ArrayRef, DataChunk}; +use risingwave_common::log::LogSuppresser; use risingwave_common::row::{OwnedRow, Row}; use risingwave_common::types::{DataType, Datum}; use thiserror_ext::AsReport; @@ -49,7 +52,10 @@ pub struct LogReport; impl EvalErrorReport for LogReport { fn report(&self, error: ExprError) { - tracing::error!(error=%error.as_report(), "failed to evaluate expression"); + static LOG_SUPPERSSER: LazyLock = LazyLock::new(LogSuppresser::default); + if let Ok(suppressed_count) = LOG_SUPPERSSER.check() { + tracing::error!(error=%error.as_report(), suppressed_count, "failed to evaluate expression"); + } } } diff --git a/src/stream/src/executor/actor.rs b/src/stream/src/executor/actor.rs index cace2087c9df9..4f8a1a998f243 100644 --- a/src/stream/src/executor/actor.rs +++ b/src/stream/src/executor/actor.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::sync::atomic::{AtomicUsize, Ordering}; -use std::sync::Arc; +use std::sync::{Arc, LazyLock}; use anyhow::anyhow; use await_tree::InstrumentAwait; @@ -21,6 +21,7 @@ use futures::future::join_all; use hytra::TrAdder; use parking_lot::Mutex; use risingwave_common::error::ErrorSuppressor; +use risingwave_common::log::LogSuppresser; use risingwave_common::metrics::GLOBAL_ERROR_METRICS; use risingwave_common::util::epoch::EpochPair; use risingwave_expr::expr_context::expr_context_scope; @@ -84,7 +85,10 @@ impl ActorContext { } pub fn on_compute_error(&self, err: ExprError, identity: &str) { - tracing::error!(identity, error = %err.as_report(), "failed to evaluate expression"); + static LOG_SUPPERSSER: LazyLock = LazyLock::new(LogSuppresser::default); + if let Ok(suppressed_count) = LOG_SUPPERSSER.check() { + tracing::error!(identity, error = %err.as_report(), suppressed_count, "failed to evaluate expression"); + } let executor_name = identity.split(' ').next().unwrap_or("name_not_found"); let mut err_str = err.to_report_string();