-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Additional logging and friendlier error messages #893
Conversation
The delay is due to importing 128 blocks at a time in |
@@ -231,8 +231,8 @@ impl<Message> Handler for IoManager<Message> where Message: Send + Clone + Sync | |||
fn notify(&mut self, event_loop: &mut EventLoop<Self>, msg: Self::Message) { | |||
match msg { | |||
IoMessage::Shutdown => { | |||
self.workers.clear(); | |||
event_loop.shutdown(); |
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.
@arkpar Could you have a look at this? Does it make any sense to shutdown event_loop
before clearing workers
?
clear()
drops workers and locks until they process all work, but my guess is that some messages might still be added to the channel for them if we don't shutdown event_loop
?
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.
If event loop is destroyed while workers are active they might panic trying to send notification to the event loop. Any particular reason to remove this?
If there are unhandled events left in the event loop that's fine cause we just ignore them. We don't have to process anything after Shutdown
event.
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.
Ok, reverting. I thought that because event_loop
is not shut down workers may still get additional work because event_loop
is active. My understanding was that swapping those two lines will block any new events from event_loop
and after that we will wait for workers to process what's pending.
Probably solves #848 also - when compiled in debug it takes significant amount of time between
Closing...
message and stopping the application (my cpu goes high during that time also) - I will check backtraces what's happening in that particular moment, but having hard time to reproduce stalling afterCtrl+C
.