Post warning if window service isn't receiving any data (#5269)

automerge
This commit is contained in:
Sagar Dhawan 2019-07-24 12:46:10 -07:00 committed by Grimes
parent c3a941086d
commit 937816e67b
1 changed files with 9 additions and 1 deletions

View File

@ -214,6 +214,7 @@ impl WindowService {
.num_threads(sys_info::cpu_num().unwrap_or(NUM_THREADS) as usize) .num_threads(sys_info::cpu_num().unwrap_or(NUM_THREADS) as usize)
.build() .build()
.unwrap(); .unwrap();
let mut now = Instant::now();
loop { loop {
if exit.load(Ordering::Relaxed) { if exit.load(Ordering::Relaxed) {
break; break;
@ -237,12 +238,19 @@ impl WindowService {
) { ) {
match e { match e {
Error::RecvTimeoutError(RecvTimeoutError::Disconnected) => break, Error::RecvTimeoutError(RecvTimeoutError::Disconnected) => break,
Error::RecvTimeoutError(RecvTimeoutError::Timeout) => (), Error::RecvTimeoutError(RecvTimeoutError::Timeout) => {
if now.elapsed() > Duration::from_secs(30) {
warn!("Window does not seem to be receiving data. Ensure port configuration is correct...");
now = Instant::now();
}
}
_ => { _ => {
inc_new_counter_error!("streamer-window-error", 1, 1); inc_new_counter_error!("streamer-window-error", 1, 1);
error!("window error: {:?}", e); error!("window error: {:?}", e);
} }
} }
} else {
now = Instant::now();
} }
} }
}) })