From 190875c83c51ceeacee688512e2d59474cd4989a Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:27:09 +0800 Subject: [PATCH] fix: remove overly strict assertion during stream pause/resume (#18131) --- src/stream/src/executor/stream_reader.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/stream/src/executor/stream_reader.rs b/src/stream/src/executor/stream_reader.rs index 92a31979c1c5..30de0804b0ac 100644 --- a/src/stream/src/executor/stream_reader.rs +++ b/src/stream/src/executor/stream_reader.rs @@ -95,14 +95,18 @@ impl StreamReaderWithPause { /// Pause the data stream. pub fn pause_stream(&mut self) { - assert!(!self.paused, "already paused"); + if self.paused { + tracing::warn!("already paused"); + } tracing::info!("data stream paused"); self.paused = true; } - /// Resume the data stream. Panic if the data stream is not paused. + /// Resume the data stream. pub fn resume_stream(&mut self) { - assert!(self.paused, "not paused"); + if !self.paused { + tracing::warn!("not paused"); + } tracing::info!("data stream resumed"); self.paused = false; }