diff --git a/crates/starknet_sequencer_infra/src/component_client/local_component_client.rs b/crates/starknet_sequencer_infra/src/component_client/local_component_client.rs index f5a3bede15..f8bf3098e3 100644 --- a/crates/starknet_sequencer_infra/src/component_client/local_component_client.rs +++ b/crates/starknet_sequencer_infra/src/component_client/local_component_client.rs @@ -3,7 +3,7 @@ use infra_utils::type_name::short_type_name; use serde::de::DeserializeOwned; use serde::Serialize; use tokio::sync::mpsc::{channel, Sender}; -use tracing::info; +use tracing::warn; use crate::component_client::ClientResult; use crate::component_definitions::{ComponentClient, ComponentRequestAndResponseSender}; @@ -102,7 +102,7 @@ where Response: Send + Sync, { fn drop(&mut self) { - info!("Dropping local client {}.", short_type_name::()); + warn!("Dropping {}.", short_type_name::()); } } diff --git a/crates/starknet_sequencer_infra/src/component_server/local_component_server.rs b/crates/starknet_sequencer_infra/src/component_server/local_component_server.rs index 4cc49d0920..923941f1c7 100644 --- a/crates/starknet_sequencer_infra/src/component_server/local_component_server.rs +++ b/crates/starknet_sequencer_infra/src/component_server/local_component_server.rs @@ -4,7 +4,7 @@ use std::marker::PhantomData; use async_trait::async_trait; use infra_utils::type_name::short_type_name; use tokio::sync::mpsc::Receiver; -use tracing::{debug, error, info}; +use tracing::{debug, error, info, warn}; use crate::component_definitions::{ ComponentRequestAndResponseSender, @@ -203,6 +203,18 @@ where } } +impl Drop + for BaseLocalComponentServer +where + Component: ComponentRequestHandler, + Request: Send + Sync, + Response: Send + Sync, +{ + fn drop(&mut self) { + warn!("Dropping {}.", short_type_name::()); + } +} + async fn request_response_loop( rx: &mut Receiver>, component: &mut Component, diff --git a/crates/starknet_sequencer_infra/src/component_server/remote_component_server.rs b/crates/starknet_sequencer_infra/src/component_server/remote_component_server.rs index 7c16b9a05a..1e0163880e 100644 --- a/crates/starknet_sequencer_infra/src/component_server/remote_component_server.rs +++ b/crates/starknet_sequencer_infra/src/component_server/remote_component_server.rs @@ -7,8 +7,10 @@ use hyper::body::to_bytes; use hyper::header::CONTENT_TYPE; use hyper::service::{make_service_fn, service_fn}; use hyper::{Body, Request as HyperRequest, Response as HyperResponse, Server, StatusCode}; +use infra_utils::type_name::short_type_name; use serde::de::DeserializeOwned; use serde::Serialize; +use tracing::warn; use crate::component_client::{ClientError, LocalComponentClient}; use crate::component_definitions::{ @@ -191,3 +193,13 @@ where Ok(()) } } + +impl Drop for RemoteComponentServer +where + Request: Serialize + DeserializeOwned + Send + Sync + 'static, + Response: Serialize + DeserializeOwned + Send + Sync + 'static, +{ + fn drop(&mut self) { + warn!("Dropping {}.", short_type_name::()); + } +}