Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(udf): ensure always_retry_on_network_error does so for all tonic errors #15458

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion ci/scripts/run-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ echo "--- e2e, $mode, batch"
RUST_LOG="info,risingwave_stream=info,risingwave_batch=info,risingwave_storage=info" \
cluster_start
sqllogictest -p 4566 -d dev './e2e_test/ddl/**/*.slt' --junit "batch-ddl-${profile}"
sqllogictest -p 4566 -d dev './e2e_test/background_ddl/basic.slt' --junit "batch-ddl-${profile}"
if [[ $mode != "single-node" ]]; then
sqllogictest -p 4566 -d dev './e2e_test/background_ddl/basic.slt' --junit "batch-ddl-${profile}"
fi
sqllogictest -p 4566 -d dev './e2e_test/visibility_mode/*.slt' --junit "batch-${profile}"
sqllogictest -p 4566 -d dev './e2e_test/ttl/ttl.slt'
sqllogictest -p 4566 -d dev './e2e_test/database/prepare.slt'
Expand Down
7 changes: 4 additions & 3 deletions src/expr/udf/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
#[derive(Error, Debug, Box, Construct)]
#[thiserror_ext(newtype(name = Error))]
pub enum ErrorInner {
#[error("failed to connect to UDF service: {0}")]
Connect(#[from] tonic::transport::Error),

#[error("failed to send requests to UDF service: {0}")]
Tonic(#[from] tonic::Status),

Expand Down Expand Up @@ -58,6 +55,10 @@ impl Error {
_ => false,
}
}

pub fn is_tonic_error(&self) -> bool {
matches!(self.inner(), ErrorInner::Tonic(_))
}
}

static_assertions::const_assert_eq!(std::mem::size_of::<Error>(), 8);
11 changes: 8 additions & 3 deletions src/expr/udf/src/external.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,15 @@ impl ArrowFlightUdfClient {
let mut backoff = Duration::from_millis(100);
loop {
match self.call(id, input.clone(), fragment_id).await {
Err(err) if err.is_connection_error() => {
tracing::error!(error = %err.as_report(), "UDF connection error. retry...");
Err(err) if err.is_tonic_error() => {
tracing::error!(error = %err.as_report(), "UDF tonic error. retry...");
}
ret => {
if ret.is_err() {
tracing::error!(error = %ret.as_ref().unwrap_err().as_report(), "UDF error. exiting...");
}
return ret;
}
ret => return ret,
}
tokio::time::sleep(backoff).await;
backoff *= 2;
Expand Down
Loading