Skip to content

Commit 95f8f3d

Browse files
authored
fix: Retry on MetadataError during service lookup (#415)
1 parent 8f3f86c commit 95f8f3d

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/service_discovery.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,17 @@ impl<Exe: Executor> ServiceDiscovery<Exe> {
7171
== Some(command_lookup_topic_response::LookupType::Failed as i32)
7272
{
7373
let error = response.error.and_then(crate::error::server_error);
74-
if error == Some(crate::message::proto::ServerError::ServiceNotReady) {
74+
if matches!(
75+
error,
76+
Some(
77+
crate::message::proto::ServerError::ServiceNotReady
78+
| crate::message::proto::ServerError::MetadataError,
79+
)
80+
) {
7581
if operation_retry_options.max_retries.is_none()
7682
|| operation_retry_options.max_retries.unwrap() > current_retries
7783
{
78-
error!("lookup({}) answered ServiceNotReady, retrying request after {}ms (max_retries = {:?})", topic, operation_retry_options.retry_delay.as_millis(), operation_retry_options.max_retries);
84+
error!("lookup({}) failed with {:?}, retrying request after {}ms (max_retries = {:?})", topic, error, operation_retry_options.retry_delay.as_millis(), operation_retry_options.max_retries);
7985
current_retries += 1;
8086
self.manager
8187
.executor

0 commit comments

Comments
 (0)