Skip to content
Snippets Groups Projects
Commit 79bf7fc5 authored by Jonathan de Jong's avatar Jonathan de Jong
Browse files

some logging shuffling

parent 7e579f8d
No related branches found
No related tags found
No related merge requests found
...@@ -150,11 +150,16 @@ fn read_lock(&self) -> HoldingConn<'_> { ...@@ -150,11 +150,16 @@ fn read_lock(&self) -> HoldingConn<'_> {
} }
} }
log::debug!("read_lock: All permanent readers locked, obtaining spillover reader...");
// We didn't get a connection from the permanent pool, so we'll dumpster-dive for recycled connections. // We didn't get a connection from the permanent pool, so we'll dumpster-dive for recycled connections.
// Either we have a connection or we dont, if we don't, we make a new one. // Either we have a connection or we dont, if we don't, we make a new one.
let conn = match self.spills.try_take() { let conn = match self.spills.try_take() {
Some(conn) => conn, Some(conn) => conn,
None => Self::prepare_conn(&self.path, None).unwrap(), None => {
log::debug!("read_lock: No recycled connections left, creating new one...");
Self::prepare_conn(&self.path, None).unwrap()
}
}; };
// Clone the spill Arc to mark how many spilled connections actually exist. // Clone the spill Arc to mark how many spilled connections actually exist.
...@@ -163,8 +168,6 @@ fn read_lock(&self) -> HoldingConn<'_> { ...@@ -163,8 +168,6 @@ fn read_lock(&self) -> HoldingConn<'_> {
// Get a sense of how many connections exist now. // Get a sense of how many connections exist now.
let now_count = Arc::strong_count(&spill_arc) - 1 /* because one is held by the pool */; let now_count = Arc::strong_count(&spill_arc) - 1 /* because one is held by the pool */;
log::debug!("read_lock: all readers locked, creating spillover reader...");
// If the spillover readers are more than the number of total readers, there might be a problem. // If the spillover readers are more than the number of total readers, there might be a problem.
if now_count > self.readers.len() { if now_count > self.readers.len() {
log::warn!( log::warn!(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment