Skip to content

Commit

Permalink
return timeout cancel on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Oct 25, 2023
1 parent 8221d3a commit 8286d63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/meta/service/src/ddl_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ impl DdlService for DdlServiceImpl {
}

async fn wait(&self, _request: Request<WaitRequest>) -> Result<Response<WaitResponse>, Status> {
self.ddl_controller.wait().await;
self.ddl_controller.wait().await?;
Ok(Response::new(WaitResponse {}))
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/meta/src/rpc/ddl_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1097,17 +1097,18 @@ impl DdlController {
}
}

pub async fn wait(&self) {
pub async fn wait(&self) -> MetaResult<()> {
for _ in 0..30 * 60 {
if self
.catalog_manager
.list_creating_background_mvs()
.await
.is_empty()
{
break;
return Ok(());
}
sleep(Duration::from_secs(1)).await;
}
return Err(MetaError::cancelled("timeout".into()));
}
}

0 comments on commit 8286d63

Please sign in to comment.