-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed Metrics from the Event Loop #679
Conversation
client/src/main.rs
Outdated
@@ -98,7 +98,13 @@ async fn run( | |||
) | |||
.await?; | |||
|
|||
spawn_in_span(shutdown.with_cancel(p2p_event_loop.run(ot_metrics.clone()))); | |||
spawn_in_span(shutdown.with_cancel(p2p_event_loop.run())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should run event loop after the call to resubscribe to avoid skipping an event.
client/src/main.rs
Outdated
let metrics_clone = ot_metrics.clone(); | ||
tokio::spawn(async move { | ||
let stream = BroadcastStream::new(event_receiver.resubscribe()); | ||
metrics_clone.handle_event_stream(stream).await |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we create stream in the handle_event_stream
so we can reduce code in the main fn to:
tokio::spawn(metrics_clone.handle_event_stream(event_receiver.resubscribe()))
crawler/src/main.rs
Outdated
@@ -100,7 +101,13 @@ async fn run(config: Config, db: DB, shutdown: Controller<String>) -> Result<()> | |||
) | |||
.await?; | |||
|
|||
spawn_in_span(shutdown.with_cancel(p2p_event_loop.run(ot_metrics.clone()))); | |||
spawn_in_span(shutdown.with_cancel(p2p_event_loop.run())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing for this run, lets move it after resubscribe.
fat/src/main.rs
Outdated
@@ -100,7 +101,13 @@ async fn run(config: Config, db: DB, shutdown: Controller<String>) -> Result<()> | |||
) | |||
.await?; | |||
|
|||
spawn_in_span(shutdown.with_cancel(p2p_event_loop.run(ot_metrics.clone()))); | |||
spawn_in_span(shutdown.with_cancel(p2p_event_loop.run())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing for this run, lets move it after resubscribe.
No description provided.