-
Notifications
You must be signed in to change notification settings - Fork 6
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
Stop all actors at once instead of stopping/joining threads sequentially #85
base: main
Are you sure you want to change the base?
Conversation
Change-Id: Iaf8c28a18cf041f162f98e769f6b42f344285811
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.
LGTM with two nits. Let's test this in portal
. .)
// Stopping actors in the reverse order in which they were spawned. | ||
// We send the Stop control message to all actors first so they can | ||
// all shut down in parallel, so actors will be in the process of | ||
// stopping when we join the threads below. |
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.
tiny nit present simple, imperative form of comments
// Stopping actors in the reverse order in which they were spawned. | |
// We send the Stop control message to all actors first so they can | |
// all shut down in parallel, so actors will be in the process of | |
// stopping when we join the threads below. | |
// Stop actors in the reverse order in which they were spawned. | |
// Send the Stop control message to all actors first so they can | |
// all shut down in parallel, so actors will be in the process of | |
// stopping when we join the threads below. |
let actor_name = entry.name(); | ||
|
||
if let Err(e) = entry.control_addr().send(Control::Stop) { | ||
warn!("control channel is closed: {} ({})", actor_name, e); |
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.
Preexisting, but It'd be nice to mention a context where this is happening and the consequence (to please @strohel). For instance:
warn!("control channel is closed: {} ({})", actor_name, e); | |
warn!("Couldn't send Control::Stop to {} to shut it down. Proceeding to shut down remaining actors: {}", actor_name, e); |
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.
The new wording is confusing to me, the error message should come after the first sentence, not the second one. I'd just remove the "Proceeding" sentence.
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.
My take:
warn!("control channel is closed: {} ({})", actor_name, e); | |
warn!("Couldn't send Control::Stop to {} to shut it down: {}. Ignoring and proceeding.", actor_name, e); |
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.
Nice, the app crashes one second faster for me now!
let actor_name = entry.name(); | ||
|
||
if let Err(e) = entry.control_addr().send(Control::Stop) { | ||
warn!("control channel is closed: {} ({})", actor_name, e); |
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.
The new wording is confusing to me, the error message should come after the first sentence, not the second one. I'd just remove the "Proceeding" sentence.
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.
IIUC this is blocked until at least the panics in https://github.com/tonarino/portal/pull/3579 are fixed, so marking as request changes until then.
Closes #12