Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
Fixed the shutdown warning
Browse files Browse the repository at this point in the history
  • Loading branch information
chotchki committed Aug 28, 2021
1 parent c44d9ae commit 00d4860
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/engine/io/file_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ impl FileManager {

impl Drop for FileManager {
fn drop(&mut self) {
if !self.request_queue.is_closed() {
if self.request_queue.is_closed() {
return;
}
error!("File Manager wasn't shutdown cleanly! This is a bug, please report!");
Expand Down
7 changes: 3 additions & 4 deletions src/engine/io/file_manager/file_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::constants::PAGE_SIZE;
use crate::engine::io::file_manager::ResourceFormatter;
use crate::engine::io::page_formats::{PageId, PageOffset};
use bytes::{Bytes, BytesMut};
use futures::SinkExt;
use lru::LruCache;
use std::collections::{HashMap, VecDeque};
use std::convert::TryFrom;
Expand Down Expand Up @@ -112,7 +113,7 @@ impl FileExecutor {
if let Some(sender) = shut_sender {
shutdown_sender = Some(sender);
self.receive_queue.close();
info!("Got shutdown request");
debug!("File Executor: Got shutdown request");
} else {}
}
recv_completed = receive_completed.recv() => {
Expand All @@ -125,9 +126,7 @@ impl FileExecutor {
file_handles_open = file_handles_open.saturating_sub(1);
}
}
} else {
break;
}
} else {}
}
maybe_recv = self.receive_queue.recv(), if request_queue.len() < MAX_FILE_HANDLE_COUNT => {
if let Some((page_id, req_type)) = maybe_recv {
Expand Down
2 changes: 1 addition & 1 deletion src/feophant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl FeOphant {

//Clean up
match self.file_manager.shutdown().await {
Ok(_) => {}
Ok(_) => info!("File Manager shutdown!"),
Err(e) => error!("Had an error shutting down I/O {0}", e),
}

Expand Down

0 comments on commit 00d4860

Please sign in to comment.