Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
massimoalbarello committed Jan 23, 2024
2 parents 88274b2 + c4468b5 commit f8384de
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/ic-websocket-gateway/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ic_websocket_gateway"
version = "1.3.0"
version = "1.3.1"
edition.workspace = true
rust-version.workspace = true
repository.workspace = true
Expand Down
7 changes: 4 additions & 3 deletions src/ic-websocket-gateway/src/client_session_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tokio::{
sync::mpsc::{self, Receiver, Sender},
};
use tokio_tungstenite::accept_async;
use tracing::{debug, info, span, warn, Instrument, Level, Span};
use tracing::{debug, field, info, span, warn, Instrument, Level, Span};

/// Handler of a client IC WS session
pub struct ClientSessionHandler {
Expand Down Expand Up @@ -63,8 +63,7 @@ impl ClientSessionHandler {
Receiver<IcWsCanisterMessage>,
) = mpsc::channel(100);

let client_session_span =
span!(parent: &Span::current(), Level::TRACE, "Client Session");
let client_session_span = span!(parent: &Span::current(), Level::TRACE, "Client Session", canister_id = field::Empty);

let client_session = ClientSession::init(
self.id,
Expand Down Expand Up @@ -142,6 +141,8 @@ impl ClientSessionHandler {
client_session_span.clone(),
);

client_session_span.record("canister_id", canister_id.to_string());

// TODO: figure out if it is guaranteed that all threads see the updated state of the gateway
// before relaying the message to the IC
client_session
Expand Down
2 changes: 1 addition & 1 deletion src/ic-websocket-gateway/src/ws_listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl WsListener {
let accept_client_connection_span = span!(
Level::DEBUG,
"Accept Connection",
?client_addr,
client_addr = ?client_addr.ip(),
client_id = self.next_client_id
);
let client_id = self.next_client_id;
Expand Down

0 comments on commit f8384de

Please sign in to comment.