Skip to content

Commit

Permalink
Revert "Exploratory logging"
Browse files Browse the repository at this point in the history
This reverts commit 03c24fe.
  • Loading branch information
criminosis committed Sep 27, 2024
1 parent cebe99a commit 3b894b4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
1 change: 0 additions & 1 deletion gremlin-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ futures = { version = "0.3.1", optional = true}
pin-project-lite = { version = "0.2", optional = true}
tokio = { version = "1", optional=true, features = ["full"] }

log = "0.4.22"

[dependencies.uuid]
features = ["serde", "v4"]
Expand Down
15 changes: 0 additions & 15 deletions gremlin-client/src/aio/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ mod tokio_use {
}

use futures::TryFutureExt;
use log::{error, info, warn};
#[cfg(feature = "tokio-runtime")]
use tokio_use::*;

Expand Down Expand Up @@ -138,7 +137,6 @@ impl Conn {
let url = url::Url::parse(&opts.websocket_url()).expect("failed to parse url");

let websocket_config = opts.websocket_options.as_ref().map(WebSocketConfig::from);
info!("Openning websocket connection");

#[cfg(feature = "async-std-runtime")]
let (client, _) = {
Expand All @@ -161,7 +159,6 @@ impl Conn {
.await?
};

info!("Opened websocket connection");
let (sink, stream) = client.split();
let (sender, receiver) = channel(20);
let requests = Arc::new(Mutex::new(HashMap::new()));
Expand All @@ -187,7 +184,6 @@ impl Conn {
.send(Cmd::Msg((sender, id, payload)))
.await
.map_err(|e| {
error!("Marking websocket connection invalid on send error");
self.valid = false;
e
})?;
Expand All @@ -203,7 +199,6 @@ impl Conn {
GremlinError::WebSocket(_)
| GremlinError::WebSocketAsync(_)
| GremlinError::WebSocketPoolAsync(_) => {
error!("Marking websocket connection invalid on received error");
self.valid = false;
}
_ => {}
Expand All @@ -219,13 +214,11 @@ impl Conn {

impl Drop for Conn {
fn drop(&mut self) {
warn!("Websocket connection instance dropped");
send_shutdown(self);
}
}

fn send_shutdown(conn: &mut Conn) {
warn!("Websocket connection instance shutting down channel");
conn.sender.close_channel();
}

Expand All @@ -242,7 +235,6 @@ fn sender_loop(
let mut guard = requests.lock().await;
guard.insert(msg.1, msg.0);
if let Err(e) = sink.send(Message::Binary(msg.2)).await {
error!("Sink sending error occured");
let mut sender = guard.remove(&msg.1).unwrap();
sender
.send(Err(GremlinError::from(Arc::new(e))))
Expand All @@ -252,24 +244,20 @@ fn sender_loop(
drop(guard);
}
Cmd::Pong(data) => {
info!("Sending Pong");
sink.send(Message::Pong(data))
.await
.expect("Failed to send pong message.");
}
Cmd::Shutdown => {
warn!("Shuting down connection");
let mut guard = requests.lock().await;
guard.clear();
}
},
None => {
warn!("Sending loop breaking");
break;
}
}
}
warn!("Sending loop closing sink");
let _ = sink.close().await;
});
}
Expand All @@ -285,7 +273,6 @@ fn receiver_loop(
Some(Err(error)) => {
let mut guard = requests.lock().await;
let error = Arc::new(error);
error!("Receiver loop error");
for s in guard.values_mut() {
match s.send(Err(error.clone().into())).await {
Ok(_r) => {}
Expand Down Expand Up @@ -319,13 +306,11 @@ fn receiver_loop(
}
}
Message::Ping(data) => {
info!("Received Ping");
let _ = sender.send(Cmd::Pong(data)).await;
}
_ => {}
},
None => {
warn!("Receiver loop breaking");
break;
}
}
Expand Down

0 comments on commit 3b894b4

Please sign in to comment.