Skip to content

Commit

Permalink
Merge pull request #83 from shotover/v19andloggingchanges
Browse files Browse the repository at this point in the history
upversionandfixlogs
  • Loading branch information
benbromhead committed Dec 22, 2020
2 parents d3b6a6c + fe0bd7b commit 5925e4e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shotover-proxy"
version = "0.0.18"
version = "0.0.19"
authors = ["Ben <ben@instaclustr.com>"]
edition = "2018"

Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![recursion_limit = "256"]

use anyhow::{anyhow, Result};
use clap::crate_version;
use clap::Clap;
use metrics_runtime::Receiver;
use tracing::{debug, info};
Expand All @@ -16,7 +17,7 @@ use std::net::SocketAddr;
use tokio::runtime;

#[derive(Clap)]
#[clap(version = "0.0.18", author = "Instaclustr")]
#[clap(version = crate_version!(), author = "Instaclustr")]
struct ConfigOpts {
#[clap(short, long, default_value = "config/topology.yaml")]
pub topology_file: String,
Expand Down Expand Up @@ -50,6 +51,7 @@ fn main() -> Result<()> {
.try_init()
.map_err(|e| anyhow!("couldn't start logging - {}", e))?;

info!("Starting Shotover {}", crate_version!());
info!(
"Loaded the following configuration file: {}",
params.config_file
Expand Down
12 changes: 3 additions & 9 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,19 +326,13 @@ where
},
Err(_) => {
match idle_time {
0..=10 => debug!("Connection Idle for more than {} seconds {}", idle_time, self.conn_details),
11..=35 => warn!("Connection Idle for more than {} seconds {}", idle_time, self.conn_details),
0..=10 => trace!("Connection Idle for more than {} seconds {}", idle_time, self.conn_details),
11..=35 => trace!("Connection Idle for more than {} seconds {}", idle_time, self.conn_details),
_ => {
warn!("Dropping Connection Idle for more than {} seconds {}", idle_time, self.conn_details);
debug!("Dropping Connection Idle for more than {} seconds {}", idle_time, self.conn_details);
return Ok(())
}
}

if idle_time > 60 {
warn!("Connection Idle for more than {} seconds {}", idle_time, self.conn_details);
} else {
debug!("Connection Idle for more than {} seconds {}", idle_time, self.conn_details);
}
idle_time *= 2;
continue
}
Expand Down
5 changes: 2 additions & 3 deletions src/transforms/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ use std::sync::Arc;
use tokio::sync::mpsc::{channel, Receiver, Sender};
use tokio::sync::oneshot::Receiver as OneReceiver;
use tokio::sync::Mutex;
use tokio::time::timeout;
use tokio::time::Duration;
use tokio::time::Instant;
use tracing::{info, trace, warn};
use tracing::{debug, info, trace, warn};

type InnerChain = Vec<Transforms>;

Expand Down Expand Up @@ -159,7 +158,7 @@ impl TransformChain {
};
}

warn!("buffered chain processing thread exiting, stopping chain loop and dropping");
debug!("buffered chain processing thread exiting, stopping chain loop and dropping");
});

BufferedChain {
Expand Down

0 comments on commit 5925e4e

Please sign in to comment.