Skip to content

Commit

Permalink
Merge pull request redis-rs#253 from shachlanAmazon/missing-traces
Browse files Browse the repository at this point in the history
Add some helpful logs.
  • Loading branch information
shachlanAmazon authored Jun 7, 2023
2 parents 512185e + fa775a3 commit 4a7e759
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 5 additions & 1 deletion babushka-core/tests/utilities/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ impl RedisCluster {

fn parse_start_script_output(output: &str) -> (String, Vec<AddressInfo>) {
let cluster_folder = output.split("CLUSTER_FOLDER=").collect::<Vec<&str>>();
assert!(!cluster_folder.is_empty() && cluster_folder.len() >= 2);
assert!(
!cluster_folder.is_empty() && cluster_folder.len() >= 2,
"{:?}",
cluster_folder
);
let cluster_folder = cluster_folder.get(1).unwrap().lines();
let cluster_folder = cluster_folder.collect::<Vec<&str>>();
let cluster_folder = cluster_folder.first().unwrap().to_string();
Expand Down
4 changes: 3 additions & 1 deletion node/src/SocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class SocketConnection {

protected constructor(socket: net.Socket, options?: ConnectionOptions) {
// if logger has been initialized by the external-user on info level this log will be shown
Logger.instance.log("info", "connection", `construct socket`);
Logger.instance.log("info", "Client lifetime", `construct client`);
this.responseTimeout =
options?.responseTimeout ?? DEFAULT_TIMEOUT_IN_MILLISECONDS;
this.socket = socket;
Expand Down Expand Up @@ -393,6 +393,7 @@ export class SocketConnection {
this.promiseCallbackFunctions.forEach(([, reject]) => {
reject(errorMessage);
});
Logger.instance.log("info", "Client lifetime", "disposing of client");
this.socket.end();
}

Expand All @@ -403,6 +404,7 @@ export class SocketConnection {
): Promise<any> {
const connection = constructor(connectedSocket, options);
await connection.connectToServer(options);
Logger.instance.log("info", "Client lifetime", "connected to server");
return connection;
}

Expand Down

0 comments on commit 4a7e759

Please sign in to comment.