Skip to content

Commit

Permalink
Merge pull request #1125 from sozu-proxy/unknown-tasks
Browse files Browse the repository at this point in the history
correct debug statements
  • Loading branch information
Keksoj authored Aug 7, 2024
2 parents 1859915 + daa5c02 commit 995eb6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions bin/src/command/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ impl CommandHub {
let id = self.next_client_id();
let session = ClientSession::new(channel, id, token);
info!("Register new client: {}", id);
debug!("{:#?}", session);
debug!("registering client {:?}", session);
self.clients.insert(token, session);
}

Expand Down Expand Up @@ -295,7 +295,7 @@ impl CommandHub {
/// - manage timeouts of tasks
pub fn run(&mut self) {
let mut events = Events::with_capacity(100);
debug!("running the command hub: {:#?}", self);
debug!("running the command hub: {:?}", self);

loop {
let run_state = self.run_state;
Expand Down Expand Up @@ -401,7 +401,7 @@ impl CommandHub {
}
ClientResult::CloseSession => {
info!("Closing client {}", client.id);
debug!("{:#?}", client);
debug!("closing client {:?}", client);
self.event_subscribers.remove(&token);
self.clients.remove(&token);
}
Expand Down Expand Up @@ -447,14 +447,15 @@ impl CommandHub {
}

let Some(task_id) = self.in_flight.get(&response.id).copied() else {
error!("Got a response for an unknown task: {}", response);
// this will appear on startup, when requesting status. It is inconsequential.
warn!("Got a response for an unknown task: {}", response);
return;
};

let task = match self.tasks.get_mut(&task_id) {
Some(task) => task,
None => {
error!("Got a response for an unknown task");
warn!("Got a response for an unknown task");
return;
}
};
Expand Down
4 changes: 2 additions & 2 deletions command/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1375,8 +1375,8 @@ impl ConfigBuilder {
frontend.key.clone_from(&https_listener.key);
}
if frontend.certificate.is_none() {
debug!("known addresses: {:#?}", self.known_addresses);
debug!("frontend: {:#?}", frontend);
debug!("known addresses: {:?}", self.known_addresses);
debug!("frontend: {:?}", frontend);
return Err(ConfigError::WrongFrontendProtocol(
ListenerProtocol::Https,
));
Expand Down
2 changes: 1 addition & 1 deletion command/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@ impl ConfigState {
/// Types like `HttpFrontend` are converted into protobuf ones, like `RequestHttpFrontend`
pub fn cluster_state(&self, cluster_id: &str) -> Option<ClusterInformation> {
let configuration = self.clusters.get(cluster_id).cloned()?;
info!("{:#?}", configuration);
info!("{:?}", configuration);

let http_frontends: Vec<RequestHttpFrontend> = self
.http_fronts
Expand Down

0 comments on commit 995eb6b

Please sign in to comment.