Skip to content

Commit

Permalink
fix: fix incorrect status code
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu committed Sep 18, 2023
1 parent 906ca48 commit d7e1530
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/datanode/src/alive_keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,8 @@ mod test {
// wait for countdown task to finish
let before_await = Instant::now();
let (finish_instant, result) = rx.await.unwrap();
// the mock region server cannot close the region
assert_eq!(result, Some(false));
// it returns `RegionNotFound`
assert_eq!(result, Some(true));
// this task should be finished after 5 * heartbeat_interval_millis
// we assert 4 times here
assert!(
Expand Down
3 changes: 2 additions & 1 deletion src/datanode/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,11 +518,12 @@ impl ErrorExt for Error {
| MissingInsertBody { .. }
| ShutdownInstance { .. }
| JoinTask { .. }
| RegionNotFound { .. }
| RegionEngineNotFound { .. }
| UnsupportedOutput { .. }
| GetRegionMetadata { .. } => StatusCode::Internal,

RegionNotFound { .. } => StatusCode::RegionNotFound,

StartServer { source, .. }
| ShutdownServer { source, .. }
| WaitForGrpcServing { source, .. } => source.status_code(),
Expand Down

0 comments on commit d7e1530

Please sign in to comment.