Skip to content

Commit

Permalink
MANTA-4961 rebalancer job should not start if storinfo is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
rjloura committed Mar 9, 2020
1 parent 7ac4b23 commit f9e3669
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion manager/src/storinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use quickcheck::{Arbitrary, Gen};
use quickcheck_helpers::random::string as random_string;
use rebalancer::error::Error;
use reqwest;
use reqwest::{self, StatusCode};
use serde::{Deserialize, Serialize};
use std::sync::{
atomic::{AtomicBool, Ordering},
Expand Down Expand Up @@ -205,6 +205,17 @@ fn fetch_sharks(host: &str) -> Vec<StorageNode> {
return vec![];
}
};

trace!("Got picker response: {:#?}", response);

// Storinfo, or our connection to it, is sick. So instead of
// breaking out of the loop and possibly returning partial results we
// return an empty Vec.
if response.status() != StatusCode::OK {
error!("Could not contact storinfo service {:#?}", response);
return vec![];
}

let result: Vec<StorageNode> =
response.json().expect("picker response format");

Expand Down

0 comments on commit f9e3669

Please sign in to comment.